The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Multiline JTable header Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Multiline JTable header" Watch "Multiline JTable header" New topic
Author

Multiline JTable header

Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Anybody implemented multiline table header ? I would like to know whether it's possible to implement this without adding additional characters like /n in column names.I'm trying to display "Origin Airport" , "Destination Airport" in 2 lines.
Thanks
[This message has been edited by Dilipkumar Kalyankar (edited April 05, 2001).]
Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
You can use HTML in Swing components. less than sign 'P' greater than sign would work as a line separator.
[This message has been edited by Paul Smiley (edited April 05, 2001).]
Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Paul,
In my FBN assignment I'm reading column names from db.db instead of hardcoding. So it will be difficult to include HTML or any other characters in column names without writing a special method to go through all the method names and insert less than sign 'P' greater than sign if the column name is very big.
Thanks
Sam Wong
Ranch Hand

Joined: Dec 07, 2000
Posts: 133
If you must implement multi line headers, then I would suggest creating your own custom renderer for the headers. Within that, you can alter the value to include HTML tags. It's not that heavy at all.
 
 
subject: Multiline JTable header
 
Threads others viewed
criteriaFind().. implementation
Problem in displaying JTable multiline headers with icons in jdk1.2
Onyone knows whats going on in Atlanta
Getting an reference to an object rather than a value
WA #1.....word association
developer file tools