请完成下列Java程序:使用JTabbedPane在窗口顶部建立一个图形标签,包含有两个标签窗格,一个使用简
注意:请勿改动main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。程序运经结果如下:import javax.swing.*;import java.awt.*;import java.awt.event.*;public class ex8_2 extends JPane1 {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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
程序运经结果如下:import javax.swing.*;import java.awt.*;import java.awt.event.*;public class ex8_2 extends JPane1 {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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
import javax.swing.*;import java.awt.*;import java.awt.event.*;public class ex8_2 extends JPane1 {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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
import javax.swing.*;import java.awt.*;import java.awt.event.*;public class ex8_2 extends JPane1 {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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
import java.awt.*;import java.awt.event.*;public class ex8_2 extends JPane1 {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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
import java.awt.event.*;public class ex8_2 extends JPane1 {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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
public class ex8_2 extends JPane1 {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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
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 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
JLabel l=new JLabel("Welcome to the NCR Examination!");______________;______________;setLayout(new BorderLayout());add(jtp,"Center");}public static void main(String args[]){ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
______________;______________;setLayout(new BorderLayout());add(jtp,"Center");}public static void main(String args[]){ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
______________;setLayout(new BorderLayout());add(jtp,"Center");}public static void main(String args[]){ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
setLayout(new BorderLayout());add(jtp,"Center");}public static void main(String args[]){ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
add(jtp,"Center");}public static void main(String args[]){ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
}public static void main(String args[]){ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
public static void main(String args[]){ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
ex8_2 obi8_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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
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(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
str = str.substring(6);JFrame. frm = new JFrame(str);frm.addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent we) {System.exit(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
JFrame. frm = new JFrame(str);frm.addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent we) {System.exit(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
frm.addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent we) {System.exit(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
public void windowClosing(WindowEvent we) {System.exit(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
System.exit(O);}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
}});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
});frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
frm.getContentPane () .add(obj8_2);frm.setSize(300, 200);frm.setVisible(true);}}
frm.setSize(300, 200);frm.setVisible(true);}}
frm.setVisible(true);}}
}}
}
点击查看答案