wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes How to disable the table list - JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to disable the table list - JTable " Watch "How to disable the table list - JTable " New topic
Author

How to disable the table list - JTable

sahitya
Greenhorn

Joined: May 01, 2008
Posts: 14
Hi

I used JTable for displaying the list of items. My application will perform some action when the user clicks on any one of the items in the list.

I need to disable the table list when the user clicks on one of the buttons available in the GUI. There shouldn't be any mouse click events on the table list after I press the button and also no action should be taken.

How can I do that??

I used JTable.setEnable(false). Its not working.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Originally posted by sahitya sahitya:
I used JTable for displaying the list of items. My application will perform some action when the user clicks on any one of the items in the list.

I need to disable the table list when the user clicks on one of the buttons available in the GUI. There shouldn't be any mouse click events on the table list after I press the button and also no action should be taken.

How can I do that??

I used JTable.setEnable(false). Its not working.

How about using a boolean class that the Table's mouselistener uses to determine if the mouse click will do anything.

Something like so:
sahitya
Greenhorn

Joined: May 01, 2008
Posts: 14
thanks...the problem is solved
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37950
    
  22
"Sahiyta Sahitya" please confirm that is your real name; it does not appear to conform with our naming policy.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Originally posted by Campbell Ritchie:
"Sahiyta Sahitya" please confirm that is your real name; it does not appear to conform with our naming policy.


Indeed!
It translates to "literature literature" or "stuff stuff"


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to disable the table list - JTable
 
Similar Threads
JTable
JTable(!!!)
jtable checkbox
create JTable
jtable