62,614
社区成员
发帖
与我相关
我的任务
分享
class PaintFrame extends Frame {
@Override
public void paint(Graphics g) {
g.setColor(new Color(10, 100, 30));
g.fillOval(30, 40, 50, 60);
g.setColor(Color.GREEN);
g.fillRect(80, 80, 40, 40);
}
public PaintFrame() {
this.setBounds(200, 200, 500, 500);
this.setLayout(null);
Button b = new Button("Hello");
this.add(b);
b.setBounds(300, 300, 50, 30);
this.setVisible(true);
}
}