setTitle("java2"); setSize(WIDTH, HEIGHT); FillPanel panel=new FillPanel(); panel, sctBackground(SystemColor, desktop); Container contentPane=getContentPane(); contentPane, add(panel); public static final int WIDTH=400; public static final int HEIGHT=250;
class FiI1Panel extends JPanel
public void paintComponent(Graphics g)
______; g. setColor(new Color(10,10,10)); g. drawRect(10,10,100,30); g. setColor(new Color(100,100,100)); g. drawRoundRect(150,10,100,30,15,15); g. setColor(new Color(150,150,150)); g. drawOval(280,10,80,30); g. setColor(new Color(10,10,10)); g. fillRect(10,110,100,30); g. setColor(new Color(100,100,100)); g. fillRoundRect(150,110,100,30,15,15); g. setColor(new Color(150,150,150)); g. fillOval(280,110,80,30); g. setColor(Color, white); Font f=new Font("宋体",______, 20); g. setFont(f); g. drawString("欢迎学习 Java!", 150,200);