关于画椭圆的问题
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);
}
}
//怎么我运行的时候,只是画了半个椭圆?
搜索更多相关的解决方案:
椭圆
----------------解决方案--------------------------------------------------------
我运行了,没问题啊
----------------解决方案--------------------------------------------------------
解决了!
----------------解决方案--------------------------------------------------------