Class JRoundedPanel

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

public class JRoundedPanel extends JPanel
JPanel with a rounded border and optional gradient background. This specialized panel provides visual enhancement for UI components with rounded corners and customizable styling options. Commonly used in RibbonTab and other Hironico.net components for a modern, polished appearance.
See Also:
  • Field Details

    • LIGHT_BLUE_COLOR

      public static final Color LIGHT_BLUE_COLOR
      Default light blue color used for gradient backgrounds
  • Constructor Details

    • JRoundedPanel

      public JRoundedPanel()
  • Method Details

    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides the default paint with a rounded border and optional gradient fill. Provides custom rendering with rounded corners and gradient background when enabled.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics object to use for painting
    • isGradientBackground

      public boolean isGradientBackground()
      Checks if gradient background is currently enabled.
      Returns:
      true if gradient background is enabled, false otherwise
    • setGradientBackground

      public void setGradientBackground(boolean gradientBackground)
      Enables or disables gradient background rendering. When enabled, the panel displays a gradient fill from white to light blue.
      Parameters:
      gradientBackground - true to enable gradient background, false to disable
    • getBorderColor

      public Color getBorderColor()
      Gets the current border color.
      Returns:
      the Color used for drawing the rounded border
    • setBorderColor

      public void setBorderColor(Color borderColor)
      Sets the border color for the rounded rectangle. Changes the color used to draw the panel's rounded border.
      Parameters:
      borderColor - the Color to use for the border