import java.awt.*; public class Main { public static void main(String[] args) { Frame f = new Frame("Fill Round Rectangle Example"); f.setVisible(true); f.setSize(500, 500); Graphics g = f.getGraphics(); g.setColor(Color.RED); g.fillRoundRect(100, 100, 200, 100, 50, 50); } }
import java.awt.*; public class Main { public static void main(String[] args) { Frame f = new Frame("Fill Round Rectangle Example"); f.setVisible(true); f.setSize(500, 500); Graphics g = f.getGraphics(); g.setColor(Color.BLUE); g.fillRoundRect(100, 100, 200, 100, 50, 50); g.setColor(Color.BLACK); g.drawRoundRect(100, 100, 200, 100, 50, 50); } }These examples belong to the java.awt.packages library.