Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Connecting JFrames in Netbeans (http://www.velocityreviews.com/forums/t388670-connecting-jframes-in-netbeans.html)

Mithil 11-16-2006 06:56 PM

Connecting JFrames in Netbeans
 
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 11-24-2006 09:34 PM

Re: Connecting JFrames in Netbeans
 
Mithil wrote:

> 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

SamieDee 09-06-2012 05:17 PM

What if I need to connect another JFrame from a previous one and I don't need the initial one to stay visible, what code do I use pls?


All times are GMT. The time now is 04:29 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.