这是我的简单代码。我想在椭圆形上以3像素的厚度添加轮廓,并且我希望轮廓颜色为蓝色,但是我不知道如何添加轮廓。
public class Ellipse extends JPanel {
public Ellipse(){
this.setPreferredSize(new Dimension (800,500));
this.setBackground(Color.WHITE);
}
protected void clear(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.orange);
g2d.draw(new Ellipse2D.Double(650,100,50,100));
g2d.fillOval(650, 100, 50, 100);
}