Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2007, 04:47 PM
Member
 
Join Date: Jun 2007
Location: Colombo, Sri Lanka
Posts: 32
hiranya is on a distinguished road
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
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2007, 05:17 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Check JDialog class. It can be used as the second frame you described when you specify its parent as the first JFrame.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-05-2007, 09:23 AM
Member
 
Join Date: Jun 2007
Location: Colombo, Sri Lanka
Posts: 32
hiranya is on a distinguished road
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
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Handling Cookies in JSP (III) JavaForums Java Blogs 0 03-31-2008 06:50 PM
Handling Cookies in JSP (II) JavaForums Java Blogs 0 03-31-2008 06:50 PM
problem with getting new JFrames geork New To Java 0 02-09-2008 02:46 PM
SWT Event Handling Java Tip Java Tips 0 12-30-2007 02:21 PM
Event Handling luisarca Sun Java Wireless Toolkit 5 05-07-2007 08:05 PM


All times are GMT +3. The time now is 03:18 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org