Results 1 to 4 of 4
Thread: Size of JTable
- 04-11-2009, 01:22 AM #1
Member
- Join Date
- Feb 2009
- Location
- Sacramento CA
- Posts
- 17
- Rep Power
- 0
- 04-11-2009, 05:10 AM #2
Senior Member
- Join Date
- Jan 2009
- Posts
- 671
- Rep Power
- 5
The TableModel controls the size. The API documentation has an example.
- 04-11-2009, 06:36 AM #3
You can use the setPreferredSize method. For scrollPane sizing I often use something like
Java Code:Dimension d = table.getPreferredSize(); // Make changes to [i]d[/i] if you like... table.setPreferredScrollableViewportSize(d);
- 04-15-2009, 04:55 AM #4
Member
- Join Date
- Feb 2009
- Location
- Sacramento CA
- Posts
- 17
- Rep Power
- 0
Actually I solved my problem like this
bottomContainer.add(hiddenBoxBottomA);
bottomContainer.add(new JScrollPane(resultTable));
bottomContainer.add(hiddenBoxBottomB);
bottomContainer.setPreferredSize(new Dimension(100,200)); //controls the size of bottomContainer
bottomContainer.revalidate();
I set the size of the bottomContainer which contains the JScrollPane which contains the JTabel called resultTable
Similar Threads
-
Setting frame size to the size of an image
By Yoruichi in forum AWT / SwingReplies: 5Last Post: 04-22-2009, 04:37 PM -
Set the Size of jvm.log file
By kasidandu in forum New To JavaReplies: 0Last Post: 03-16-2009, 04:08 PM -
Jtable duplicates through Hashtable (JTable condition problem) my assignment plz help
By salmanpirzada1 in forum Advanced JavaReplies: 2Last Post: 05-15-2008, 10:15 AM -
Object size
By kavithas in forum New To JavaReplies: 0Last Post: 11-30-2007, 12:00 PM -
how to set an image size
By valery in forum New To JavaReplies: 1Last Post: 08-06-2007, 08:27 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks