Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / August 2006

Tip: Looking for answers? Try searching our database.

make jtable uneditable

Thread view: 
Brandon McCombs - 23 Aug 2006 02:24 GMT
Hello,

I want to make a jtable uneditable but still allow double clicks to
register so that a dialog window appears instead of the cell editor
being invoked. What is the easiest way to make the jtable uneditable or
at least disable the celleditor from being invoked when i double click
on a jtable?  Will I need to roll my own jtable and override a method?

I'm using whatever default celleditor a jtable is configured to use and
I'm using a defaulttablemodel for the data model of the jtable and I'm
adding vectors of data to the model, if that matters at all with respect
to what I'm trying to accomplish.

thanks
Brandon
mtp - 23 Aug 2006 10:06 GMT
> Hello,
>
[quoted text clipped - 8 lines]
> adding vectors of data to the model, if that matters at all with respect
> to what I'm trying to accomplish.

override the DefaultTableModel.isCellEditable(int row, int column)
method to return false, and add a MouseListener for spawing your dialog box

Regards
Brandon McCombs - 24 Aug 2006 02:36 GMT
>> Hello,
>>
[quoted text clipped - 14 lines]
>
> Regards

thanks, got it working using those methods.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.