File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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: 39436
    
  28
"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: 10451
    
    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!]
 
Don't get me started about those stupid light bulbs.
 
subject: How to disable the table list - JTable