• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with JTable display

 
Ranch Hand
Posts: 473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using an applet for dispalying two JLists and two JTables in the central panel.

Applet is doing some computing and then displays files in the table above say table1. When this table is clicked on the row, appropriate file is selected and its word contents are displayed in second table which is below.

Image is here

This second table row gets sort of "bend", which straightens on selecting but some other row gets "bend" and so on till the table soon gets ugly.

I am using a class BadarTableModel which extends AbstractTableModel. Both the tables use it.

Maybe changing row values to String from Object will affect its behaviour?

Thanks,

Maki Jav
[ January 31, 2008: Message edited by: Maki Jav ]
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The selection (line# 29) in the upper table seems to show two lines of text as if the text has wrapped in the cell. You can try calling setPreferredWidth on the first TableColumn to make it smaller and expand/stretch the table width to see if you can get all the text on a single line to see if this is what is happening. If so, you may have to manage/control the text that goes into each line. LineBreakMeasurer can help with this and has an example in the comments section.
 
Maki Jav
Ranch Hand
Posts: 473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

Where is LineBrekMeasurer you say?

Maki Jav
 
reply
    Bookmark Topic Watch Topic
  • New Topic