Problem1187--Java 类的继承

1187: Java 类的继承

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 35  Solved: 30
[Submit] [Status] [Web Board] [Creator:]

Description

代码如下:

import javax.swing.*;
import java.awt.*;
 
public class Java_2 {
 
    public static void main(String[] args) {
        WelcomFrame frame = new WelcomFrame();
        //*********Found********** 
        frame.setDefaultCloseOperation(JFrame._____________________);
        frame.show();
    }
}
//*********Found********** 
class WelcomFrame extends ___________________ {
 
    public WelcomFrame() {
        setTitle("Java等级考试");
        //*********Found********** 
        ___________________(DEFAULT_WIDTH, DEFAULT_HEIGHT);
        WelcomPanel panel = new WelcomPanel();
        Container contentPane = getContentPane();
        contentPane.add(panel);
    }
    public static final int DEFAULT_WIDTH = 250;
    public static final int DEFAULT_HEIGHT = 100;
}
//*********Found********** 
class WelcomPanel extends ___________________ {
 
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawString("欢迎参加Java等级考试!", MESSAGE_X, MESSAGE_Y);
    }
    public static final int MESSAGE_X = 60;
    public static final int MESSAGE_Y = 50;
}

Source/Category