aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How Can I Get the Column Names and Widths (in pixels)  from a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How Can I Get the Column Names and Widths (in pixels)  from a JTable" Watch "How Can I Get the Column Names and Widths (in pixels)  from a JTable" New topic
Author

How Can I Get the Column Names and Widths (in pixels) from a JTable

Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

I want to save the column names and the column widths to disk and restore them for a JTable.

I don't see how to do this. Can somebody help me out?

-- Kaydell
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

One way might be the preference API
An example can be found at http://www.devdaily.com/blog/post/java/simple-java-preferences-api-example


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
your subject title says how do I get..., but the message say how do I save...

if you want to 'get' the info, here's a simple demo
run the demo, click button, drag one of the column widths wider, click button,
drag the columns around (different order), click button

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Can I Get the Column Names and Widths (in pixels) from a JTable