select1.java~4~

来自「该文件中包含有源代码及一部分的文档,该系统是一个小型的英语单词字典的系统.」· JAVA~4~ 代码 · 共 63 行

JAVA~4~
63
字号
package logindemo;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class select1 {
    public select1() {
        select1 theApp = new select1();
        JPanel cards1;
        JPanel panel3 = new JPanel();
        JPanel card1 = new JPanel();
        card1.add(new JTextArea("请输入书名"));
        card1.add(new JButton("搜索"));
        JPanel card2 = new JPanel();
        card2.add(new JTextArea("请输入作者"));
        card2.add(new JButton("搜索"));
        JPanel card3 = new JPanel();
        card1.add(new JTextArea("请输入类别"));
        card1.add(new JButton("搜索"));
        JPanel card4 = new JPanel();
        card2.add(new JTextArea("请输入出版社"));
        card2.add(new JButton("搜索"));
        panel3.add(card1);
        panel3.add(card2);
        panel3.add(card3);
        panel3.add(card4);
        panel3.add(theApp.cards1);
        theApp.cards1 = new JPanel(new CardLayout());
        theApp.cards1.add(card1,menuItem1);
        theApp.cards1.add(card2,menuItem2);
        theApp.cards1.add(card3,menuItem3);
        theApp.cards1.add(card4,menuItem4);

    }
    public void comboItemStateChanged(ItemEvent evt) {
        CardLayout c1 = (CardLayout)(cards1.getLayout());
        c1.show(cards1,(String)evt.getItem());
    }
}
class ComboItemListenerClass implements ItemListener {
    select1 theApp;
    ComboItemListenerClass(select1 theApp) {
        this.theApp = theApp;

    }
    public void itemStateChanged(ItemEvent evt) {
        theApp.comboItemStateChanged(evt);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?