Results 1 to 3 of 3
Thread: Handling Two JFrames
- 11-03-2007, 02:47 PM #1
Member
- Join Date
- Jun 2007
- Location
- Colombo, Sri Lanka
- Posts
- 32
- Rep Power
- 0
Handling Two JFrames
Hi,
I have a JFrame with a button on it. I want a second Jframe to appear when the user clicks on the button. Also the first Jframe should be inactive while the second Jframe is displayed and it should be re-enabled when the user closes the second Jframe. Second Jframe should be always displayed on top of the first Jframe.
I know how to do this in C#. Can anybody tell me the Java way of doing this? I would appreciate some example code segments as well.
Regards,
Hiranya
- 11-03-2007, 03:17 PM #2
Check JDialog class. It can be used as the second frame you described when you specify its parent as the first JFrame.
- 11-05-2007, 07:23 AM #3
Member
- Join Date
- Jun 2007
- Location
- Colombo, Sri Lanka
- Posts
- 32
- Rep Power
- 0
Thanks
Thanks for the tip. It directed me in the right direction. So for all folks out there here's how to do this.
The second form should extend the JDialog class.
Then call the setModalityType() method on the second form with the Application_Modality parameter.
Regards,
Hiranya
Similar Threads
-
problem with getting new JFrames
By geork in forum New To JavaReplies: 0Last Post: 02-09-2008, 12:46 PM -
SWT Event Handling
By Java Tip in forum Java TipReplies: 0Last Post: 12-30-2007, 12:21 PM -
Event Handling
By luisarca in forum Sun Java Wireless ToolkitReplies: 5Last Post: 05-07-2007, 06:05 PM


LinkBack URL
About LinkBacks

Bookmarks