Results 1 to 6 of 6
- 06-16-2010, 01:02 PM #1
JTable Auto Resize Mode - not working as I expect
Am I doing this wrong, or am I expecting something different from what it actually does?
I assumed that, from the API description, that if I set AUTO_RESIZE_ALL_COLUMNS, that each column would be resized to take up only the width that the data required. Instead, what I am seeing is that every column takes up exactly the same size. If my assumption is wrong, is there a way to get the columns to size themselves by the content?
table = new JTable(model);
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COL UMNS);
- 06-16-2010, 04:49 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,158
- Rep Power
- 5
Table Column Adjuster « Java Tips Weblogis there a way to get the columns to size themselves by the content?
- 06-16-2010, 06:47 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Thanks for that code; I bluntly copied and pasted it (still playing with it). I did put the credits in my 'about' box though ;-) b.t.w. if you're interested you can participate/read/download/play/whatever with my project code; it's an IDE for my home brew language RPL (Reverse Polish Lisp) and I confess, I took some parts of your code, either verbatim or just the ideas for the IDE part. PM me your email address because I have to 'invite' you to be a participant of the project at Project Management Software, Online Collaboration and Document Sharing ~ Huddle. The other member of the 'team' *ahem* is r035198x, also a participant of this forum.
kind regards,
Jos
- 06-16-2010, 06:58 PM #4
Thanks both, it works perfectly!
- 06-16-2010, 10:05 PM #5
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,158
- Rep Power
- 5
@Jos,
As my "About" page says, I just do this for fun so I'm not interested in getting any more involved. Glad you found the code usefull. Take whatever you want, its there to be used however people see fit.
- 06-17-2010, 08:03 AM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Ok, but you're in my about box anyway ;-) If you ever change your mind give me a PM; RPL is not so much about Swing as well as computer algebra systems, a bit of compiler technology, symbolic expression fiddling and lisp like evaluation (my hobby). Thanks again for the code; very nifty stuff.
kind regards,
Jos
Similar Threads
-
Print not working on my JTable with custom CellRenderer
By flizbert in forum AWT / SwingReplies: 2Last Post: 02-07-2011, 03:01 PM -
How to implement auto complete functionality in a cell in JTable?
By javaexplorer in forum AWT / SwingReplies: 0Last Post: 06-04-2010, 04:20 PM -
Working with Jtable
By blu_fox88 in forum AWT / SwingReplies: 3Last Post: 02-20-2010, 04:49 PM -
JScrollpane auto resize
By knuth in forum New To JavaReplies: 3Last Post: 09-29-2009, 10:12 PM -
Auto-complete/Auto-fix for custom statement
By dark_cybernetics in forum EclipseReplies: 0Last Post: 08-19-2008, 11:19 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks