How to set 1column size to be different from the rest?

hey all,

I have a JTable and i have made it 2 look like a spreadsheet.

The fisrt column look like a row header.

anyhow

i want the first row to be as small as possible width wise.

and the rest to be divided evenly.

oh will am asking about columns, how can i stop the column to be repositioned?

The Columns are the days of the week, and i don't want the user to move them around.

thanks

[440 byte] By [avdzma] at [2007-11-26 22:33:51]
# 1

To set column widths in a [url=http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JTable.html]JTable[/url]:

// You will need a loop here

table.getColumnModel().getColumn(<index>).setPreferredWidth(<width>)

To disable reordering columns:

table.getTableHeader().setReorderingAllowed(false);

I'm assuming you could also accomplish the same goal by extending JTable.

ignignokt84a at 2007-7-10 11:41:13 > top of Java-index,Desktop,Core GUI APIs...
# 2
> The fisrt column look like a row header.Then make it a row header: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=571508
camickra at 2007-7-10 11:41:13 > top of Java-index,Desktop,Core GUI APIs...