| Author |
To set Jtable height when the number of row increased?
|
Raji Raj
Greenhorn
Joined: Feb 18, 2011
Posts: 12
|
|
Hi All,
In jtable,i have given "setPreferredScrollableViewportSize".but i need to chnage the size of the table if the number of rows increaed.
Problem::
Since i have given the "setPreferredScrollableViewportSize",its taking only that size.I am increasing row by giving one button,if i change the "setPreferredScrollableViewportSize" in jbutton listener,there is no effect.
Please kindly help to resolve this.
Thanks,
Raj.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
First of all, why did you set it explicitly? What's wrong with letting the JTable calculate it for you?
Add a TableModelListener to the JTable's model, and listening for insertion and deletion events.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Raji Raj
Greenhorn
Joined: Feb 18, 2011
Posts: 12
|
|
Hi ,
Thanks for you reply.but Intially while lodaing the table how will it take the table height?
Thanks,
Raj
|
 |
 |
|
|
subject: To set Jtable height when the number of row increased?
|
|
|