简单应用题
请完成下列Java程序:使用JTabbedPane在窗口顶部建立一个图形标签,包含有两个标签窗格,一个使用简单表签(Label)显示欢迎信息,一个使用按钮和图标。注意:请勿改动main( )主方法和其他已有语句内容,仅在下划线处填入适当的语句。
程序运经结果如下:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ex8_2 extends JPanel{
public ex8_2( ){
JTabbedPane jtp=new JTabbedPane(SwingConstants.BOTTOM);
Icon icon=new ImageIcon("icon.gif");
JButton btn=new JButton(icon);
JLabel l=new JLabel("Welcome to the NCR Examination!");
;
;
setLayout(new BorderLayout( ));
add(jtp,"Center");
}
public static void main(String args[]){
ex8_2 obj8_2=new ex8_2( );
String str = obj8_2.getClass( ).toString( );
if(str.indexOf("class") != -1)
str = str.substring(6);
JFrame frm = new JFrame(str);
frm.addWindowListener(new WindowAdapter( ) {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});
frm.getContentPane( ).add(obj8_2);
frm.setSize(300, 200);
frm.setVisible(true);
}
}
题库:计算机等级考试
类型:简答题
时间:2021-06-06 15:01:24
免费下载:《问答》Word试卷
简单应用题
请完成下列Java程序:使用JTabbedPane在窗口顶部建立一个图形标签,包含有两个标签窗格,一个使用简单表签(Label)显示欢迎信息,一个使用按钮和图标。注意:请勿改动main( )主方法和其他已有语句内容,仅在下划线处填入适当的语句。
程序运经结果如下:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ex8_2 extends JPanel{
public ex8_2( ){
JTabbedPane jtp=new JTabbedPane(SwingConstants.BOTTOM);
Icon icon=new ImageIcon("icon.gif");
JButton btn=new JButton(icon);
JLabel l=new JLabel("Welcome to the NCR Examination!");
;
;
setLayout(new BorderLayout( ));
add(jtp,"Center");
}
public static void main(String args[]){
ex8_2 obj8_2=new ex8_2( );
String str = obj8_2.getClass( ).toString( );
if(str.indexOf("class") != -1)
str = str.substring(6);
JFrame frm = new JFrame(str);
frm.addWindowListener(new WindowAdapter( ) {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});
frm.getContentPane( ).add(obj8_2);
frm.setSize(300, 200);
frm.setVisible(true);
}
}
本题关键词:一次性使用医用垫单,简单压力容器使用管理,一次性使用中单(垫单),一次性使用垫单(巾),一次性使用医用口罩,一次性使用洗肠用具包,一次性使用无菌医用垫单,路面使用指标,使用部位,一次性使用口罩;