JPanel transPanel = new JPanel(new FlowLayout());\r
transPanel.add(new JLabel("Transparency"));\r
transPanel.add(transparency);\r
+ JButton button = new JButton("Invert Selection");\r
+ transPanel.add(button);\r
+ button.addActionListener(new ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent evt)\r
+ {\r
+ invertSelection();\r
+ }\r
+ });\r
\r
//////////////////////////////////////////////\r
//We're going to need those OK cancel buttons\r
JPanel buttonPanel = new JPanel(new FlowLayout());\r
- JButton button = new JButton("OK");\r
+ button = new JButton("OK");\r
button.addActionListener(new ActionListener()\r
{\r
public void actionPerformed(ActionEvent evt)\r
ex.printStackTrace();\r
}\r
}\r
+ }\r
+\r
+ public void invertSelection()\r
+ {\r
+ for(int i=0; i<table.getRowCount(); i++)\r
+ {\r
+ Boolean value = (Boolean)table.getValueAt(i,2);\r
+\r
+ table.setValueAt(\r
+ new Boolean(!value.booleanValue()),\r
+ i,2);\r
+ }\r
\r
}\r
\r