举个简单的例子
//<applet code = Paint.class width=600 height=400>
//</applet>
import javax.swing.*;
import java.applet.*;
import java.awt.*;
public class Paint extends Applet {
public void init(){
JButton b1 = new JButton("开始");
this.setLayout(null);
b1.setBounds(100,100,80,40);
this.add(b1);
}
public void paint(Graphics g){
g.drawString("12345",100,120);
}
}
白板的微信
相关分类