> I have one question about closing windows produced by mainFrame. In the
> following codes, windows "normal frame1" and "normal frame2" produced
[quoted text clipped - 47 lines]
>
> //***************************************************************
Well, I don't have "com.sun.j3d" so I couldn't actually run your
example, but I just wanted to comment that your code is pretty confusing.
For example, why did you name your main class "JFrame2" if it is not, in
fact, a JFrame? It would probably be better to name it "JFrameDemo" or even
"Test". With "Test", you don't get much information, but no information is
better than misleading information.
As for your actual question, I don't know. If MainFrame is an instance
of JFrame, did you try setDefaultCloseOperation() ?
- Oliver
tony_lincoln@yahoo.com - 31 Aug 2005 20:07 GMT
Thanks for your words. As shown in codes:
Frame newf4 = new MainFrame(new Applet(), 256, 256);
so MainFrame is an instance of Frame, but not JFrame.
setDefaultCloseOperation() is a method in JFrame, it can not work for
MainFrame: I tried
newf4.setDefaultCloseOperation();
Javac can not resolve the symbol setDefaultCloseOperation in class
java.awt.Frame.
At the same time, windows "normal frame1" and "normal frame2" produced
by JFrame can be closed without stopping the whole program. So it is
not necessary to do more things about JFrame instance.
THe only thing to do with is MainFrame. But how? :-(
Oliver Wong - 31 Aug 2005 21:06 GMT
> Thanks for your words. As shown in codes:
> Frame newf4 = new MainFrame(new Applet(), 256, 256);
[quoted text clipped - 10 lines]
> not necessary to do more things about JFrame instance.
> THe only thing to do with is MainFrame. But how? :-(
I don't have access to the code for MainFrame, nor its documentation, so
I can't really help you with its behaviour. The only way I think I could
help you from here on is if you switch from using MainFrame to JFrame.
- Oliver
tony_lincoln@yahoo.com - 01 Sep 2005 09:01 GMT
MainFrame is to show 3D objects for users, JFrame has no this function.
So it seems that I have to use MainFrame. :-(
tony