Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Swing / AWT / SWT and the fly likes Row Selection in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Row Selection in JTable" Watch "Row Selection in JTable" New topic

Row Selection in JTable

Suhas Mohamedali

Joined: Jun 05, 2012
Posts: 29
I want to prevent selecting another row of JTable if the ' mainAction ' is equal to Actions.CHILDCHANGED OR Actions.MODIFIED
I am able to show the Error Dialog while selecting another row but once the dialog is closed it is selecting the pointed row.
I want to select the edited row once the error dialogue is closed.

Please help.

m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 161
no ideas from code posted here, for better help sooner post an SSCCE, short, runnable, compilable, just about a.m. issues
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
also can't help with a way based on the posted code, but a global way might be
to use an AWTEventListener (mouse event mask) to do:
1) get the component clicked on
2) if the table, and if(mainAction == Actions.CHILDCHANGED || mainAction == Actions.MODIFIED),
consume the event
subject: Row Selection in JTable