import javax.swing.*;
import java.awt.*;
class Wdmb extends JPanel{
public void paint(Graphics g){
g.drawOval(200, 5, 80, 90);
g.drawLine(50,100, 50,200);
g.drawRect(140,100, 50, 60);//22222这里有问题啊,
g.draw3DRect(100, 100,50,60,true);//
g.setColor(Color.cyan);//
g.fillRect(200, 100, 100,100);
} }
public class l8_1 extends JFrame{
Wdmb mb=null;
public static void main(String[]args){
l8_1 lx=new l8_1();
}
public l8_1(){
mb=new Wdmb();
this.add(mb);
this.setSize(400,300);
this.setLocation(300,280);
this.setTitle("绘图基础-练习1");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
} }
为什么会这样啊,改变横坐标怎么就变这样子了
g.drawRect(100,100, 50, 60);//
g.drawRect(140,100, 50, 60);//
这是为什么啊,怎么会变成下面的那个图啊
MMTTMM
相关分类