Forums Register Login

Problem with selection in JTable

+Pie Number of slices to send: Send
Hi,

I am having a problem that I hope someone can help me with.

I have a JTable with products and wants to select the last chosen product when I get back to the page containing the table.
To select the productobject I have created my own renderer that draws a border around the product when it is selected.

I use aProductTable.changeSelection(vRow, vCol, false, false); and it scrolls to the right position but it never draws it as selected(with a border).
If I add a sleep(1) before changing selection it draws the border so it seems to have something to do with the table not being fully painted yet or something similar.

I check that I draw in the EDT.

Any help greatly appreciated
+Pie Number of slices to send: Send
if it works OK with a sleep(1), try it like this



depending on the scope of vRow and vCol, they may need to be 'final'
+Pie Number of slices to send: Send
I have that already, I thought that should work that's why I am confused.

It is really hard to put some meaningful code exampel here so I am looking for a general tip what could be wrong but maybe that's too hard to guesss without some code.

Here is a part of my code at least:

This tiny ad is wafer thin:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 908 times.
Similar Threads
getting value from JTable
jtable
JTable is losing selection
JTable
Problem with a JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:26:24.