本题中使用了选项卡,窗口中有一个选项卡,总共有“系统”、“声卡”、“显卡”、“网卡”

题型:问答题

问题:

本题中使用了选项卡,窗口中有一个选项卡,总共有“系统”、“声卡”、“显卡”、“网卡”和“帮助”5项选项面。单击各个选项的文字标签后,所选中的选项将为当前选项。“系统”选项上有3个复选按钮,分别控制“声卡”、“显卡”和“网卡”三个选项,选中某个按钮后,它所指示的选项就可用,否则不可用。
import jav

  • a.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class java3 extends JFrame
    JTabbedPane config=new JTabbedPane();
    public java3()
    super("java3");
    setSize(500,300);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    JPanel configPane=new JPanel();
    configPane.setLayout(new BoxLayout(configPane.BoxLayout.Y_AXIS));
    JTextArea question=new JTextArea("下面的哪个选项\n"+"你想设置");
    question.setEditable(false);
    question.setMaximumSize(new Dimension(300,50));
    question.setAlignmentX(0.0f);
    question.setBackground(configPane.getBackground());
    JCheckBox audioCB=new JCheckBox("声卡",true);
    JCheckBox nicCB=new JCheckBox("网卡",true);
    JCheckBox tvCB=new JCheckBox("显示卡",false);
    configPane.add(Box.createVerticalGlue());
    configPane.add(question);
    configPane.add(audioCB);
    configPane.add(nicCB);
    configPane.add(tvCB);
    configPane.add(Box.createVerticalGlue());
    JLabel audioPane=new JLabel("声卡页面");
    JLabel nicPane=new JLabel("网卡页面");
    JLabel tvPane=new JLabel("显示卡页面");
    JLabel helpPane=new JLabel("帮助信息");
    audioCB.addItemListener(new TabManager(audioPane));
    nicCB.addItemListener(new TabManager(nicPane));
    tvCB.addItemListener(new TabManager(tvPane));
    config.addTab("系统",null,configPane,"Choose Installed Options");
    config.addTab("声卡",null,audioPane,"Audio system configuration");
    config.addTab("网卡",null,nicPane,"Networking configuration");
    config.addTab("显示卡",null,tvPane,"Video system configuration");
    config.addTab("帮助",null,helpPane,"How DoI...");
    getContentPane().add(config,BorderLayout.CENTER);

    class TabManger implements ActionListener
    Component tab;
    public TabManager(Component tabToManage)
    tab=tabToManage;
    public void ItemStateChanged(ItemEvent ie)
    int index=config.indexOfComponent(tab);
    if(index!=-1)
    config.setEnabledAt(index,ie.getStateChange()==ItemEvent.SELECTED);

    this.repaint();


    public static void main(String args[])
    java3 sc=new java3();
    sc.setVisible(true);

考点:计算机等级考试JAVA二级JAVA机试
题型:问答题

上消化道大量出血是指数小时内出血量多于

A.500ml

B.750ml

C.1000ml

D.1250ml

E.1500ml

题型:问答题

宠物医院的体重秤需要经常消毒吗?()

A、不需要

B、需要经常消毒

C、消毒最好,不消毒也无所谓

D、不能经常消毒

题型:问答题

调节尿液排泄的重要环节是()

A.肺的通调水道

B.脾的运化水液

C.肾的气化作用

D.肝的疏通三焦水道

题型:问答题

绘图题:正四棱台形混凝土浇筑漏斗上、下底面的边长分别为500mm和250mm,高为400mm;下部插管的外径为230mm,高为150mm;试绘制其正视图和俯视图并标注尺寸(不计钢板厚度)。

题型:问答题

GBM工程的要求是什么?

更多题库