File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Disabling mouse-click over JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disabling mouse-click over JTable" Watch "Disabling mouse-click over JTable" New topic

Disabling mouse-click over JTable

Ashish Chopra
Ranch Hand

Joined: Nov 30, 2004
Posts: 134

I am developing an application that requires mouse-click to be disabled on a JTable. Can anyone tell me how to do this?
I am using the defaultTable Model for the JTable..


Quis Custodiet Ipsos Custodes<br /> <br />My blog: <a href="" target="_blank" rel="nofollow"></a>
jefff willis
Ranch Hand

Joined: Sep 29, 2004
Posts: 113
Two ideas come to mind...

1. actually disable the table (and scrollpane if you have one)

2. enable mouse events but do nothing with them

Lionel Badiou
Ranch Hand

Joined: Jan 06, 2005
Posts: 140
Hi Ashish,

I'm not quite sure of what you mean exactly by 'disabling click'... Yet, you may try to use a dedicated table model :

I hope that could be useful,

Lionel Badiou
CodeFutures Software
I agree. Here's the link:
subject: Disabling mouse-click over JTable
It's not a secret anymore!