How to paint inside JPanel
问题 I have a JPanel inside a Jframe.I want to draw a line inside JPanel, using paint(Graphics g) method. But it is not working. Please Someone help me on this issue. Here is the code. Thank you all in advance. import java.awt.Color; import java.awt.Graphics; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class JavaGraph { JPanel myPanel; public JPanel createPanel() { myPanel=new JPanel(); myPanel.setLayout(null); //myPanel.setBackground(Color.black