?? instructions.java
字號:
package Chapter1;import java.io.*;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.*;import java.awt.Rectangle;import java.awt.Font;public class Instructions extends JFrame implements ActionListener{ public static final int WIDTH=400; public static final int HEIGHT=400; JLabel jLabel1 = new JLabel(); JButton jButton1 = new JButton(); public Instructions() { setSize(WIDTH,HEIGHT); setTitle("使用說明"); Container contentPane=getContentPane(); contentPane.setBackground(Color.green); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("返回")) { this.dispose(); ManagerInterface n1= new ManagerInterface(); StudentInterface n2=new StudentInterface(); if(Login.jComboBox1.getSelectedIndex()==0) { n1.setVisible(true); n2.dispose();} else if(Login.jComboBox1.getSelectedIndex()==1) { n2.setVisible(true); n1.dispose(); } } } public static void main(String[] args) { Instructions n=new Instructions(); n.setVisible(true); } private void jbInit() throws Exception { jLabel1.setFont(new java.awt.Font("Dialog", 1, 13)); jLabel1.setRequestFocusEnabled(true); jLabel1.setText("此系統用于管理學生信息,包括學生信息的輸入和查詢等功能!"); jLabel1.setBounds(new Rectangle(8, 56, 376, 152)); this.getContentPane().setLayout(null); jButton1.setBounds(new Rectangle(169, 242, 73, 25)); jButton1.setFont(new java.awt.Font("Dialog", 1, 13)); jButton1.setText("返回"); this.getContentPane().add(jLabel1, null); this.getContentPane().add(jButton1, null); jButton1.addActionListener(this); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -