R
rfractal30
Hi
I've got a question about JFrames. In a UI I created I have a button
which launches JFrames (actually they are extentions of JFrame:
ResizeFrame), each of which has the same name: 'jf'. Each JFrame
contains a panel - which is in turn displays an Image. The JFrames can
be opened to display adifferent Images (if the user so wishes).
What I really want to know is this - how is it possible to have several
JFrames opened at once, all of which have the same name: 'jf'?
What happens is that the user clicks a button, and the following code
is run:
//---
ResizeFrame jf = new ResizeFrame((w + " - Depth Map"), new Color(205,
219, 227), false);
jf.LoadPic(w);
jf.addpanel();
//---
The user can click the button any number of times - created multiple
instances of the object 'jf'. When the user closes the frame it is
dispose()d.
I've got a suspician that there is a superficial appearance of objects
being allocated, but that in actual fact these are not really allocated
objects. Either that or only the last JFrame created is allocated to
'jf' while the previous JFrames become unallocated.
I have posted a similar question a little while back, however I am now
clearer about what it is I am trying to understand - and have therefore
found a better way to phrase my question!
Any advice would be greatly appreciated.
Michael
I've got a question about JFrames. In a UI I created I have a button
which launches JFrames (actually they are extentions of JFrame:
ResizeFrame), each of which has the same name: 'jf'. Each JFrame
contains a panel - which is in turn displays an Image. The JFrames can
be opened to display adifferent Images (if the user so wishes).
What I really want to know is this - how is it possible to have several
JFrames opened at once, all of which have the same name: 'jf'?
What happens is that the user clicks a button, and the following code
is run:
//---
ResizeFrame jf = new ResizeFrame((w + " - Depth Map"), new Color(205,
219, 227), false);
jf.LoadPic(w);
jf.addpanel();
//---
The user can click the button any number of times - created multiple
instances of the object 'jf'. When the user closes the frame it is
dispose()d.
I've got a suspician that there is a superficial appearance of objects
being allocated, but that in actual fact these are not really allocated
objects. Either that or only the last JFrame created is allocated to
'jf' while the previous JFrames become unallocated.
I have posted a similar question a little while back, however I am now
clearer about what it is I am trying to understand - and have therefore
found a better way to phrase my question!
Any advice would be greatly appreciated.
Michael