[填空题] 请完善程序(程序文件名:Java_2.java)并进行调试。请在下画线处填入正确内容,然后删除下画线。请勿删除注释行和其他已有的语句内容。
[题目要求]
完善程序,使程序运行结果如下图所示。
源程序:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Java_2
public static void main(String[] args)
RadioButtonframe frame=new RadioButtonframe();
frame.setDefauhCloseOperation(Jframe.EXIT_ON_CLOSE);
(1) ;
class RadioButtonframe extends Jframe
public RadioButtonframe()
setTitle("Radio按钮实例");
setSize(DEFAULT_WIDTH,DEFAULT_HEIGHT);
Container contentPane=getContentPane();
label=new JLabel("热烈庆祝Java程序语言开考三周年");
label.setForeground(Color.yellow);
contentPane.setBackground(Color.red);<
正确答案:JRadioButton
参考解析:可以看出此处是要新建JRadioButton对象button,所以new后面应该是JRadioButton的构造方法,public JRadioButton(String text,boolean selected)——创建一个具有指定文本和选择状态的单选按钮。


![[填空题] 请完善程序(程序文件名:Java [填空题] 请完善程序(程序文件名:Java](http://www.mshxw.com/aiimages/31/585641.png)
