关于画椭圆的问题
import java.awt.Graphics;import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class DrawOval extends JApplet{
int x,y,length,width;
public void init()
{
String xs,ys,lengths,widths;
xs = JOptionPane.showInputDialog("Enter posX");
ys = JOptionPane.showInputDialog("Enter posY");
widths = JOptionPane.showInputDialog("Enter width");
lengths = JOptionPane.showInputDialog("Enter length");
x = Integer.parseInt(xs);
y = Integer.parseInt(ys);
width = Integer.parseInt(widths);
length = Integer.parseInt(lengths);
}
public void paint(Graphics g)
{
super.paint(g);
g.drawOval(x,y,width,length);
}
}
//怎么我运行的时候,只是画了半个椭圆?