java编写applet程序
来源:百度知道 编辑:UC知道 时间:2024/05/15 08:51:21
谁会啊,课程设计的一道题
随意写了下,不是很好,楼主可参考下
=======================================
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class MyApplet extends JApplet {
/** Creates a new instance of MyApplet */
public MyApplet() {
}
public void init(){
myFont = new Font("Dialog",Font.BOLD,16);
Bigger = new JButton("BIGGER");
Smaller = new JButton("Smaller");
jPanel1 = new JPanel();
jPanel2 = new JPanel();
jLabel1 = new JLabel("This is a test!!");
jLabel1.setFont(myFont);
jPanel1.setLayout(new FlowLayout());
jPanel1.add(Bigger);
jPanel1.add(Smaller);
jPanel2.add(jLabel1);
Container cp= this.getContentPane();
cp.setLayout(new BorderLayout());
cp.add(jPanel1,Bor