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.
精彩评论