Please help me with this form invocation problem.

Hi.

I'm developing an appllication using NetBeans 5.5. I wanted to know that if i build a frames X and Y how can i invoke frame Y from X using a button click event. Whats the code? Or at least please tell me which APIs to use. Both frames exist together in a package.

Waiting for reply.. Thanks.

[315 byte] By [elroydsilvaa] at [2007-11-26 17:53:57]
# 1

How do you create thre frame X?

X x = new X():

x.setVisible(true); ?

Now do this way.

Y y = new Y();

X x = new X(y);

x.setVisible(true);

This is the sample.

public class Y

{

public doSomething(X x) // x will need you to obtain X's field's values.

{

}

}

public class X

{

private Y y;

public X(Y y) // constructor.

{

this.y = y;

}

private void onButtonClicked()

{

y.doSomething(this);

}

}

FirstName2a at 2007-7-9 5:06:59 > top of Java-index,Desktop,Core GUI APIs...