Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable and clipping last collumns problem

lukasz Odulinski
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi I'm using set of classes I found on internet that extends JTable capabilities making me able to merge or split some cells.

Mentioned capability works ok but I have two problems with how the table is displayed. The extended JTable is stored in JScrollPane and it is stored in Box.

The first issue is that when I have a lot of collumns the last one or last two ( depends on how many collumns I have ) is being clipped ( when I move scrollbar to the right edge I don't see last collumn or it is clipped so only the part of the data is visible.)

I did some experiments and I add some empty collumns and that helped so I assume it is something connected with how JScrollPane gets the width of the table it should display but I could not figure out how can I change that. I was trying to call table_.setPreferredScrollableViewportSize(new Dimension()); with Dimentsion set to something really big but it did not help.

Second issue is that when I click on a cell that is placed closer to the right edge then the next cell is being selected. The further the cell is from the left edge the further cell to its right is being selected. I can't see selection when I click on the cell from last collumn.

If there is no easy answer. Maybe someone could recommend some open source alternative to display results in table with merging capabilities.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic