This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Row Selection in JTable" Watch "Row Selection in JTable" New topic
Author

Row Selection in JTable

Suhas Mohamedali
Greenhorn

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: 154
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Row Selection in JTable
 
Similar Threads
JTable
jtable
JTable blues
JTable
JTable ListSelection problem