如题.
请给个例子,研究起来容易些.先谢过.
------解决方案--------------------
???你要做什么???
------解决方案--------------------
请帮看一下.
package swingApplet;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.applet.*;
import javax.swing.*;
public class SwingApplet extends JApplet {
JButton button;
public void init(){
getContentPane().setLayout(new FlowLayout());
button = new JButton( "Hello, I 'm a Swing Button! ");
getContentPane().add(button);
}
public void stop() {
if (button != null) {
getContentPane().remove(button);
button = null;
}
}
public static void main(String[] args){
JFrame frame =new JFrame( "JFrame&JApplet ");
JApplet applet =new SwingApplet();
frame.add(applet);
applet.init();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(320,240);
frame.setVisible(true);
}
}
有错误,把applet或japplet加载到JFrame中去.
------解决方案--------------------
应该不行
applet弹出frame都会有警告,要求有安全验证