我有一个问题。
如何在不嵌入我的网页的情况下直接运行我的 java-applet?
我知道 appletViewr 可以在没有浏览器的情况下执行 applet,但我需要在没有 html 页面的情况下获取 java applet。
最佳答案
在您的代码中使用以下代码,其中 AppletClass 是您的 Applet 类。
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);
可以根据需要进行更多的定制。
关于java - 直接运行 Java 小程序(无 html 页面),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3012124/