Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

annoyed  RSS feed

 
andy keidel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a table with a row selected. I want the visible row in the middle to be the one selected. The window/table can change size. Is there a way to achieve this selection without drawing the table twice? If I don't repaint it before calling getVisibleRect(), then I get the wrong values for getVisibleRect (because swing doesn't know the answer until after the gui is drawn). But once I've done this, then I have to select the row and scroll to the right part of the table (it's in a JScrollPane).

Related.... what if I have 3 tables vertically aligned in a window. I want each table to be the same size. When the window gets resized, swing doesn't give me the correct size values until after it's drawn. So seems I need to repaint it, then get the size, then repaint the tables to the right size. Isn't there a better way?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!