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.
# 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);
}
}