📄 choose.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 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 choose extends JFrame implements ActionListener{ JLabel jLabel1 = new JLabel(); JButton 查单词 = new JButton(); JButton 存单词 = new JButton(); JButton 测验 = new JButton(); JButton 退出 = new JButton(); public choose() { try { jbInit(); } catch (Exception exception) { exception.printStackTrace(); } } private void jbInit() throws Exception { setTitle("英语一百"); getContentPane().setLayout(null); setSize(500,350); jLabel1.setText("欢迎欢迎您我们的产品!"); jLabel1.setBounds(new Rectangle(132, 46, 197, 72)); 测验.setBounds(new Rectangle(244, 171, 85, 36)); 测验.setText("测验");测验.addActionListener(this); 退出.setBounds(new Rectangle(370, 269, 85, 36)); 退出.setText("退出");退出.addActionListener(this); 存单词.setBounds(new Rectangle(138, 171, 85, 36)); 存单词.setText("存单词");存单词.addActionListener(this); this.getContentPane().add(查单词); this.getContentPane().add(退出); this.getContentPane().add(测验); this.getContentPane().add(存单词); this.getContentPane().add(jLabel1); 查单词.setBounds(new Rectangle(29, 169, 85, 36)); 查单词.setText("查单词");查单词.addActionListener(this); setVisible(true); setDefaultCloseOperation(EXIT_ON_CLOSE); } public static void main(String[] args)throws IOException { choose choose_object = new choose(); } public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("查单词")) { setVisible(false); lookup_word lookup_word_object = new lookup_word(); } else if(e.getActionCommand().equals("存单词")) { setVisible(false); input_word input_word_object = new input_word(); } else if(e.getActionCommand().equals("测验")) { if(words.radomword().equals("0;0;0;0 0")) { JOptionPane.showMessageDialog(null, "您的库是空的", "output", JOptionPane.WARNING_MESSAGE); } else { setVisible(false); test_choice test_choice_object = new test_choice(); } } else if(e.getActionCommand().equals("退出")) { setVisible(false); input input_object = new input(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -