Class Line

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class Line extends JComponent
A custom Swing component that draws a horizontal line for visual separation. This component extends JComponent and provides a simple graphical line that can be used to visually separate sections of the GUI interface.

The line is drawn in black and is automatically centered horizontally within the component's bounds. The line spans the full width of the component and is positioned at the vertical center.

This component is commonly used in the CPU simulator interface to visually separate different functional areas and provide clear boundaries between CPU components.

Since:
1.0
See Also:
  • Constructor Details

    • Line

      public Line()
  • Method Details

    • paintComponent

      public void paintComponent(Graphics g)
      Paints the line component by drawing a centered horizontal black line. The line extends from the left edge to the right edge of the component and is positioned at the vertical center.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics context used for painting the component