Reputation: 219
i have simple JFRAME (create by Netbeans) and i want to call frame.setState(Frame.NORMAL) from another class. How to do call?
public class Myclass{
public void Frame_normal{
...?
???frame.setState(Frame.NORMAL);
}
}
Upvotes: 0
Views: 4568
Reputation: 2639
Basicaly you create an attribute in your class and you give it the reference to your JFrame.
public class Myclass{
JFrame frame;
public MyClass(JFrame aFrame){
this.frame = aFrame;
}
public void Frame_normal{
frame.setState(Frame.NORMAL);
}
}
MyClass class = new Myclass(theJFrame);
class.Frame_normal();
Upvotes: 3
Reputation: 69035
You can do the following
Upvotes: 1