hello I\'m new in java programming, and i need someone explaining me these lines of code:
public class drawpanel extends JPanel
{
public void paintCom
You only need to define paintComponent()
in your class if you want to change the way your component if being drawn. In your custom implementation you need to call super.paintComponent(g);
i.e. a base class version of paintComponent()
, because it does some necessary work to prepare component for drawing.