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 / June 2006

Tip: Looking for answers? Try searching our database.

JCheckbox in a JTable

Thread view: 
layne79 - 29 Jun 2006 22:53 GMT
Hi,
my JTable has a column containing a JCheckBox (with a renderer and an
editor associated). Until now, it works by checking/unchecking the
checkbox in any of the rows, but I don't know how to let a JDialog
appear once I click on a checkBox, without selecting the checkBox.
In other words, I want to click on the checkBox oonly in order to let a
JDialog appear, then I want the checkBox be checked (selected) only
after I have pressed the button OK in the JDialog.
Now I obtain the JCheckBox selected just after I click on it and the
JDialog appears.

Hope I explained the problem.
Thanks in advance
nblloyd@gmail.com - 30 Jun 2006 16:39 GMT
The only way I can think of doing this is by removing the default mouse
listener from the checkbox and implementing your own. All the other
listeners seem to get the event only after the box has been checked, so
this may be your best bet. The downside is you lose the nice roll-over
effects and such.

Maybe someone else has a better suggestion though.

- Natasha -

> Hi,
> my JTable has a column containing a JCheckBox (with a renderer and an
[quoted text clipped - 9 lines]
> Hope I explained the problem.
> Thanks in advance
Vova Reznik - 30 Jun 2006 16:52 GMT
Set column not editable!!!
Add MouseListener to the table
Detect mouse click and show JDialog
Change or don't value in the column
(in the table model)

> The only way I can think of doing this is by removing the default mouse
> listener from the checkbox and implementing your own. All the other
[quoted text clipped - 19 lines]
>> Hope I explained the problem.
>> Thanks in advance


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.