regd. hiding of the column in JTable

Hi

I have a Table(in the pop up window) on which column dragging is enabled. In ths pop up window I want to hide the first column so that it doesn't appear and user don't have the control to change its position .

I tried the following code :

mytable.getColumnModel().removeColumn(mytable.getColumnModel().getColumn(0));

The above code is able to make my first column invisible in the window but with this code , the another problem is coming ,I m populating one more table with the help of the above pop up window.

If by dragging I make any column first column in the pop up window and apply then it make that column as the first column in the main window , but I want to keep the hidden column as the first column in the main window.

Any suggestions , any references are most welcome.

[831 byte] By [ymca_a] at [2007-11-27 5:24:23]
# 1
hey,have a look at this: http://www.java2s.com/Code/Java/Swing-Components/FixedTableColumnExample.htmthis basically puts 2 tables in 1. and then just hide the fixed table. something like that: fixedTable.setVisible(false);
izziieea at 2007-7-12 11:50:32 > top of Java-index,Desktop,Core GUI APIs...