⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 input_word.java

📁 这是一个简单的单词查询系统
💻 JAVA
字号:
//package library2;import java.awt.BorderLayout;import javax.swing.JFrame;import javax.swing.JLabel;import java.awt.*;import javax.swing.JButton;import javax.swing.JTextField;import javax.swing.JCheckBox;import javax.swing.JTextArea;import javax.swing.JToggleButton;import java.io.*;import java.text.*;import java.awt.event.*;import java.awt.*;import java.util.*;import javax.swing.*;/** * <p>Title: </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2005</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */public class input_word extends JFrame implements ActionListener{        JLabel jLabel1 = new JLabel();    JTextArea word_infor = new JTextArea();    JButton 确定 = new JButton();    JButton 退出 = new JButton();    public input_word() {        try {            jbInit();        } catch (Exception exception) {            exception.printStackTrace();        }    }    private void jbInit() throws Exception {setTitle("we");        setTitle("英语一百");                getContentPane().setLayout(null);        setSize(500,350);        jLabel1.setText("请输入单词相关信息");        jLabel1.setBounds(new Rectangle(125, 29, 218, 62));        退出.setBounds(new Rectangle(316, 261, 66, 33));        退出.setText("退出");退出.addActionListener(this);        确定.setBounds(new Rectangle(139, 252, 77, 35));        确定.setText("确定");确定.addActionListener(this);        //this.setTitle("goodstay");        this.getContentPane().add(退出);        this.getContentPane().add(jLabel1);        this.getContentPane().add(word_infor);        this.getContentPane().add(确定);        word_infor.setText("");        word_infor.setBounds(new Rectangle(97, 105, 173, 131));        setVisible(true);        setDefaultCloseOperation(EXIT_ON_CLOSE);    }   public static void main(String[] args) throws IOException    {            input_word input_word_object = new input_word();        }        public void actionPerformed(ActionEvent e)        {            if(e.getActionCommand().equals("确定"))            {                        String str;                    str = word_infor.getText();                        word_infor.setText("");                        StringTokenizer tokenizer;                        tokenizer = new StringTokenizer(str);                        String str_end, str_zh;                        int number ;                        str_end = str_zh = tokenizer.nextToken("\n");                        number = Integer.parseInt(str_zh);                        str_zh = tokenizer.nextToken("\n");                        for(int i=0; i<number; i++)                        {                                str_end = str_end + ";" + str_zh;                                str_zh = tokenizer.nextToken("\n");                        }            words.add(str_end);                   JOptionPane.showMessageDialog(null,                                                        "单词已成功存储!", "output", JOptionPane.PLAIN_MESSAGE);            }               else if(e.getActionCommand().equals("退出"))               {                           setVisible(false);                   choose choose_object = new choose();               }            }}

⌨️ 快捷键说明

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