Programming Question

Hi,
I am an amateur to Java 3D programming. Currently, I am developing a game consisting the following 2 components : a 3D JApplet which holds a composition of a JFrame.

//======================================
import java.awt.;
import java.awt.event.
;
import javax.swing.*;

public class Test extends JApplet
{
Test2 test2;

  public void init(){
        test2 = new Test2();            
        test2.setVisible(true);            
        setupClosing(test2);      
  }

  public void setupClosing(Frame frame) {

frame.addWindowListener(new WindowAdapter() {
  public void windowClosing(WindowEvent e) {
    resize(10,10);
        stop();
        destroy();
        setVisible(false);
  }
});
  }

}

class Test2 extends JFrame {

  Test2(){
        setSize(100, 100);
  }

};

//======================================

I wish to upon the exit of JFrame Test2, dispose(exit) too the JApplet. However, I have tried several options, but it always gave me Security Exception when I exited the Test2 JFrame.

Secondly, I am wondering if a 3D Java world could be displayed in a Frame?

Hence, I am wondering if you guys could kindly help me out.

It would be great if you could kindly provide the solution in code form.

Many Thanks in advance.

MfG
KH