Run Java-applets directly ( without html page )

前端 未结 7 1224
一向
一向 2021-01-05 15:58

I have a problem.

How i can run my java-applet directly without embedded in my web page?

I know appletViewr can execute applet without a browser but I need

相关标签:
7条回答
  • 2021-01-05 16:34

    Use below code with your code, where AppletClass is your Applet class.

    AppletClass appletClass = new AppletClass ();
    
    JFrame frame = new JFrame();
    frame.setLayout(new GridLayout(1, 1));
    frame.add(appletClass );
    
    // Set frame size and other properties
    ...
    
    // Call applet methods
    appletClass .init();
    appletClass .start();
    
    frame.setVisible(true);
    

    More customizations can be done as required.

    0 讨论(0)
提交回复
热议问题