[填空题] 本题中,窗口的背景色为系统桌面的颜色,在窗口中分别画空心和实心的黑色矩形、深灰色圆角矩形和浅灰色椭圆形,并且画白色粗体的“欢迎学习Java!”字符串。
import java. awt. * ;
import javax. swing. * ;
public class java2
public static void main(String[] args)
FillFrame frame=new FillFrame();
frame. setDefaultCloseOperation (JFrame. EXIT_ON_CLOSE);
frame. show();
class FillFrame extends JFrame
public FillFrame()
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)