org.tbee.swing.table
Class TableColumnChooser
java.lang.Object
java.awt.event.MouseAdapter
org.tbee.swing.table.TableColumnChooser
- All Implemented Interfaces:
- ActionListener, MouseListener, MouseMotionListener, MouseWheelListener, EventListener
public class TableColumnChooser
- extends MouseAdapter
- implements ActionListener
Create a popup menu on a JTable to show or hide columns.
Usage:
// hide some columns initially
TableColumnChooser.hideColumns(table.getColumnModel(), new int[] { 2, 4, 5, 6, 7});
// don't allow user to hide these columns
table.putClientProperty(TableColumnChooser.FIXED_COLUMNS, new int[] { 0, 8});
// and go
TableColumnChooser.install(table);
- Version:
- $Revision: 1.4 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SOURCECODE_VERSION
public static final String SOURCECODE_VERSION
- Standard variable for determining version of a class file.
- See Also:
- Constant Field Values
FIXED_COLUMNS
public static final String FIXED_COLUMNS
- See Also:
- Constant Field Values
mouseReleased
public void mouseReleased(MouseEvent me)
- Specified by:
mouseReleased in interface MouseListener- Overrides:
mouseReleased in class MouseAdapter
actionPerformed
public void actionPerformed(ActionEvent ae)
- Specified by:
actionPerformed in interface ActionListener
install
public static void install(JTable table)
uninstall
public static void uninstall(JTable table)
hideColumns
public static void hideColumns(TableColumnModel columnModel,
int[] modelColumnIndexes)
Copyright © 2012 KnowledgePlaza. All Rights Reserved.