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 / General / November 2006

Tip: Looking for answers? Try searching our database.

Connecting JFrames in Netbeans

Thread view: 
Mithil - 16 Nov 2006 18:56 GMT
Hi Everyone,
                    I am using NetBeans to do a project and i was
wondering whether i could do the follows:

have 2 files :
one.java ----------> has JFrame1 -----------> has button1,textbox1
two.java ----------> has JFrame2

and when button1 in JFrame1 is clicked JFrame2 should appear and the
value entered in textbox1 is to be sent to two.java so JFrame2 can use
it. Is this possible if so plz help me ASAP thanks for your help in
advance. Any other suggestion arround this problem would be greatly
appreciated as well.
John O'Conner - 24 Nov 2006 21:34 GMT
> and when button1 in JFrame1 is clicked JFrame2 should appear and the
> value entered in textbox1 is to be sent to two.java so JFrame2 can use
> it. Is this possible if so plz help me ASAP thanks for your help in
> advance. Any other suggestion arround this problem would be greatly
> appreciated as well.

You can create a frame and populate its component values *before* you
call setVisible(true).

SecondFrame sf = new SecondFrame();
sf.setSomeValue(textOrOtherValue);
sf.setAnotherValue(someText);
sf.setVisible(true);

If the other frame needs to be modal and is just collecting information
temporarily, maybe a dialog is appropriate.

--
John O'Conner


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.