Ronayne
asked on
load a frame once
Im using the code below to load a frame every time a user opens the class file concerned with the following code. But I want the frame only to be loaded once, just when the user loads the class for the first time, and the for the class to be dynamically updated. The if statement im tyring to use throws an error when a second user trys to concurrently load the class file. Any help would be great, thanks.
public F(int NO){
super("F");
if(NO == 0){//this flag causes an error
dis = new TextArea(20 , 10);
add("Center" , display);
resize(300 , 150);
show();
}
public F(int NO){
super("F");
if(NO == 0){//this flag causes an error
dis = new TextArea(20 , 10);
add("Center" , display);
resize(300 , 150);
show();
}
ASKER
Im creating different instances of f for different parameters passed in variable NO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
does the question mean the instance of the frame can be open one at a time?
i try this using JInternalFrame.
set
-doDefaultCloseOperation(W indowConst ants.HIDE_ ON_CLOSE); for the frame
-when you want to frame to be open, use setVisible(true);
i successfully restrict the frame to be loaded one at a time.
Feel free to discard this comment if this is not what you asking ;)
-Child that so pissed off!-
i try this using JInternalFrame.
set
-doDefaultCloseOperation(W
-when you want to frame to be open, use setVisible(true);
i successfully restrict the frame to be loaded one at a time.
Feel free to discard this comment if this is not what you asking ;)
-Child that so pissed off!-
Keep an instance to F, and reuse it.