Drawing with Java: Applying Borders/Outlines to Shapes
问题 I can't figure out how to get "g.setStroke(new BasicStroke(5));" to be set to all my created shapes (in this case ovals). My code: import java.awt.*; import java.awt.Color; import java.awt.Graphics2D; import java.awt.BasicStroke; public class Rings { public static void main(String[] args) { DrawingPanel panel = new DrawingPanel(300, 300); Graphics2D g = panel.getGraphics(); g.setStroke(new BasicStroke(5)); // Sets Outer Line Width of Shapes g.setColor(new Color(255, 0, 0)); g.fillOval(50, 50,