Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to disable the table list - JTable

 
sahitya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks...the problem is solved
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Sahiyta Sahitya" please confirm that is your real name; it does not appear to conform with our naming policy.
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic