Class WarningScrollTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class WarningScrollTable extends JRootPane

Title: Warning ScrollPanel for Tables

Description: This class will add scrollbars to a given table and displays a given warning message if the table is empty of if any of specified Vectors is empty.

Author:
Bertoli Marco Date: 7-ott-2005 Time: 14.30.24
See Also:
  • Field Details

  • Constructor Details

    • WarningScrollTable

      public WarningScrollTable(JTable table, String warningMsg)
      Constructs a new WarningScrollTable, given a table and a warning message to display if the table is empty
      Parameters:
      table - table to be shown in the panel
      warningMsg - message to be shown if the table is empty
    • WarningScrollTable

      public WarningScrollTable(JComponent component, String warningMsg)
      Constructs a new WarningScrollTable, given a component and a warning message to display if the specified vectors are empty. This implementation does not add scrollBars despite the name of this class.
      Parameters:
      component - component to be shown in the panel
      warningMsg - message to be shown if vectors are empty
  • Method Details

    • addCheckVector

      public void addCheckVector(Vector<Object> v)
      Adds a new Vector to be checked. If this method is used behaviour of WarningScrollTable will change and warning message will be shown only if any of input vectors is empty
      Parameters:
      v - input vector to be checked
    • clearCheckVectors

      public void clearCheckVectors()
      Cleans all check vectors
    • paint

      public void paint(Graphics g)
      Override default paint method
      Overrides:
      paint in class JComponent
      Parameters:
      g - graphic object
    • checkEmptyVectors

      protected boolean checkEmptyVectors()
      Tells if any vector added with addCheckVector(Vector v) method is empty
      Returns:
      true iff any vector is empty addCheckVector(Vector)
    • createWarningPanel

      protected JPanel createWarningPanel(String msg)
      Creates the panel to be shown when the table is empty
      Parameters:
      msg - message to be shown on the panel
      Returns:
      created warning panel