This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to Add a JDialog? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to Add a JDialog?" Watch "How to Add a JDialog?" New topic
Author

How to Add a JDialog?

Ulises Pulido
Ranch Hand

Joined: Jul 24, 2008
Posts: 81
Hello All:

My question is, how am I able to add a JDialog when the user does a double click or presses enter over a row in a JTable, I am looking for a listener that might help me on this but I could not find it ?

What I want is that when the user double clicks or presses enter in the JTable a JDialog appear that will help the user to see the data that is on the Row of the JTable and if it has no user yet the user can insert it in this dialog and the update on the database will be done?

I hope you can help me on this


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCJD, SCEA in progress
www.ulisespulido.com
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2247
    
    7

Well your question isn't really adding a JDialog for the table row but a table list selection listener. In my GUI design, when a row is selected, I used the list selection listener to enable my "book" button (disabled by default). The book button is a Swing action rather than an action listener. Once you have that adding the double click or enter to pop up a JDialog shouldn't be that hard I think.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Ulises Pulido
Ranch Hand

Joined: Jul 24, 2008
Posts: 81
What a great Idea!! thanks K. Tsang I will implement it as you state, and maybe I can add another button saying view details, that can show the details even if the row was already booked.

Thanks a lot !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Add a JDialog?
 
Similar Threads
JTable
JTable(!!!)
JTable
Problem with Jtable
Jtable question