| Author |
must click 2 times after clearSelection()
|
Mathias Nilsson
Ranch Hand
Joined: Aug 21, 2004
Posts: 367
|
|
Hi! I have a JTable and CustomTableCellRenderer that handles the cells color. A user should be able to mark the cell as long as the cell isn't occupied. If the cell is occupied reset the selection and the user has to make another selection. I have managed to do this but the problem is that after the table.clearSelection() method I must click on the cell 2 times to select it. Does anybody have a solution to this problem. Here is some code [ November 21, 2005: Message edited by: P.W Mathias Nilsson ]
|
SCJP1.4
|
 |
Ken Blair
Ranch Hand
Joined: Jul 15, 2003
Posts: 1078
|
|
|
Do you know for a fact that it's not selected after one click or do you assume it's not because it hasn't changed color? When and how does a cell become locked or unlocked?
|
 |
Mathias Nilsson
Ranch Hand
Joined: Aug 21, 2004
Posts: 367
|
|
The cell isn't selected after on click just 2. I implemented it in another way so it's ok for now. I have another question If a user selects a locked cell, then all the other cell that is selected should change color. Some kind of collition. If the user selects cells that isn't allowed then the whole selection should be invalid. // Mathias
|
 |
 |
|
|
subject: must click 2 times after clearSelection()
|
|
|