wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JTable Column Heading (SOS!!!) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable Column Heading (SOS!!!)" Watch "JTable Column Heading (SOS!!!)" New topic
Author

JTable Column Heading (SOS!!!)

Chhaya Dhanani
Ranch Hand

Joined: Apr 11, 2001
Posts: 70
hi all,
I have a table which is generated dynamically after picking up values from a text file.
The problem is the column title are very long strings say for eg:
"Number Of Undebited Items Per Transaction"
What happens is since the title is very long, it appears in one line thus increasing the column size
Can i have the title such that it rolls over to the next line and the column size remains small,like:
i want the column heading to go on the next line
----------------------|
Number Of Undebited |
Items per Transaction |
----------------------|
12345890 |
----------------------|
I have a deadline till tomorrow morning
Please consider this as an SOS and help me
Thanx in advance
Chhaya
Dave Rivera
Greenhorn

Joined: May 02, 2001
Posts: 4
Originally posted by Chhaya Dhanani:
hi all,
I have a table which is generated dynamically after picking up values from a text file.
The problem is the column title are very long strings say for eg:
"Number Of Undebited Items Per Transaction"
What happens is since the title is very long, it appears in one line thus increasing the column size
Can i have the title such that it rolls over to the next line and the column size remains small,like:
i want the column heading to go on the next line

The examples at this url may help:
SwingExamples
[This message has been edited by Dave Rivera (edited May 23, 2001).]
[This message has been edited by Dave Rivera (edited May 23, 2001).]
[This message has been edited by Dave Rivera (edited May 23, 2001).]
mohana konakanchi
Ranch Hand

Joined: May 16, 2001
Posts: 67
Hi
just add \n to your header.
ex: single line header
Object[]= {"mohana konkanchi is my name"}
change it to
Object[]={"mohana konakanchi\n is my name"}
hope this will help
Mohana
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JTable Column Heading (SOS!!!)
 
Similar Threads
file upload sos
SOS
Tiles in Columns (SOS!!!)
SOS!!!!!!!!!!
SOS!!!!