Re: JTable sizing
- From: Vova Reznik <address@xxxxxxxx>
- Date: Mon, 13 Mar 2006 19:33:46 GMT
Larry Coon wrote:
Roedy Green wrote:
freeze them with a set Max
Thanks. That section of the code now looks like:
JTable table = new JTable(new MyTableModel());
for (int i = 0; i < table.getColumnCount(); i++) {
TableColumn col = table.getColumnModel().getColumn(i);
col.setMinWidth(i*50+75);
if (i < table.getColumnCount() - 1)
col.setMaxWidth(i*50+75);
}
Not -exactly- what I want, but close enough. I assume that since
I'm now setting both the min & max widths, I can do away with
setting the preferred width.
One question: Since the default behavior for the horizontal scroll
bar is HORIZONTAL_SCROLLBAR_AS_NEEDED, then if I resize the window
so that it's not wide enough for the table, I should be getting a
horizontal scroll bar, right? I'm not getting one...
You don't have horizontal scroll because you defined auto resize mode.
Horizontal bar will appear if you will turn it off
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
Larry Coon.
University of California
- Follow-Ups:
- Re: JTable sizing
- From: Larry Coon
- Re: JTable sizing
- References:
- JTable sizing
- From: Larry Coon
- Re: JTable sizing
- From: Roedy Green
- Re: JTable sizing
- From: Larry Coon
- Re: JTable sizing
- From: Roedy Green
- Re: JTable sizing
- From: Larry Coon
- JTable sizing
- Prev by Date: Re: JTable sizing
- Next by Date: Re: suggestions?
- Previous by thread: Re: JTable sizing
- Next by thread: Re: JTable sizing
- Index(es):
Relevant Pages
|
Loading