I want, in a JTable, has a column that when it is clicked, a JPanel to appear with the names of all the columns, and it can select (with JCheckBox) which we want to continue in the JTable. It would be a column with "#".
Asked
Active
Viewed 143 times
1
-
2Welcome to stackoverflow. It is better to tell what you have tried so far? then it is easy for others to help you – Thusitha Thilina Dayaratne May 22 '15 at 16:32
2 Answers
1
Just create such a column in your data model implementation, with a custom artificial data object. Then register an editor (setDefaultEditor) in the jtable to show a checkbox or open a dialog with a checkbox. based on the user selection you may then alter your model (add or remove columns) and fire an according changed event.

loonytune
- 1,775
- 11
- 22
0
Not exactly what you asked for but maybe you can use the Table Column Manager.
The Table Column Manager
manages which columns are visible in the table. You invoke the Table Column Manager
by right clicking on any column in the column header. You are presented with a popup menu that uses check boxes to hide/show columns.

camickr
- 321,443
- 19
- 166
- 288