Class AbstractPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Drawable2D
Direct Known Subclasses:
AbstractLabyrinthPanel

public abstract class AbstractPanel extends JPanel implements Drawable2D
An abstract panel that provides a foundation for custom JPanel implementations. This panel implements the Drawable2D interface, allowing custom rendering of graphical content via the Drawable2D.draw(Graphics2D) method.

The paintComponent(Graphics) method is overridden to call the Drawable2D.draw(Graphics2D) method for custom rendering on the panel.

See Also:
  • Constructor Details

    • AbstractPanel

      public AbstractPanel()
  • Method Details

    • paintComponent

      protected void paintComponent(Graphics g)
      Paints the component by invoking the Drawable2D.draw(Graphics2D) method. This method is called whenever the panel needs to be re-rendered.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics object used for rendering; it is cast to Graphics2D for more advanced drawing