开发者

calling one JApplet form from another

开发者 https://www.devze.com 2023-01-18 23:04 出处:网络
I have created all my project files as swing applications, i.e files extending JApplet, howto call one JApplet file from another? i kow set visible methods are there for jFrame but now开发者_如何学JAV

I have created all my project files as swing applications, i.e files extending JApplet, how to call one JApplet file from another? i kow set visible methods are there for jFrame but now开发者_如何学JAVA i dont have time to convert everything to convert, please help as soon as possible


Basically, you can't. Or, rather, it's difficult. Running an applet requires the construction of an AppletContext and management of the applet life cycle.

A better approach would be to move all of the code you have in your applet to a JPanel. Then have a simple applet that just creates the panel.

Then, when you want to open another panel, you create a JFrame and populate it with the appropriate panel.

0

精彩评论

暂无评论...
验证码 换一张
取 消