?? welcomeframe.java~31~
字號(hào):
package stumanage;
import javax.swing.*;
import java.awt.*;
import sun.awt.image.*;
import java.awt.event.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class WelcomeFrame
extends JFrame {
JPanel jPanel1 = new MyPanel();
ImageIcon imageIcon1 = new ImageIcon("beautiful.jpg");
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel2 = new JPanel();
GridBagLayout gridBagLayout1 = new GridBagLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
JButton jButton4 = new JButton(); JButton jButton5 = new JButton();
public WelcomeFrame() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
WelcomeFrame welcomeFrame = new WelcomeFrame();
welcomeFrame.pack();
welcomeFrame.show();
}
private void jbInit() throws Exception {
imageIcon1.setDescription("beautiful.jpg");
imageIcon1.setImageObserver(this);
jPanel1.setLayout(borderLayout1);
jPanel1.setMinimumSize(new Dimension(600, 400));
jPanel1.setPreferredSize(new Dimension(600, 420));
this.setLocale(java.util.Locale.getDefault());
this.setResizable(true);
this.setSize(new Dimension(747, 396));
this.setState(Frame.NORMAL);
jPanel2.setBackground(UIManager.getColor("RadioButtonMenuItem.selectionBackground"));
jPanel2.setForeground(Color.black);
jPanel2.setMinimumSize(new Dimension(100, 30));
jPanel2.setPreferredSize(new Dimension(100, 400));
jPanel2.setLayout(gridBagLayout1);
jButton1.setToolTipText(" 個(gè)人信息管理");
jButton1.setText(" 個(gè)人信息管理");
jButton2.setToolTipText(" 選課信息管理");
jButton2.setText(" 選課信息管理");
jButton3.setToolTipText("獎(jiǎng)勵(lì)信息管理");
jButton3.setText("獎(jiǎng)勵(lì)信息管理");
jButton4.setToolTipText("職務(wù)信息管理");
jButton4.setText("職務(wù)信息管理");
jButton4.addActionListener(new WelcomeFrame_jButton4_actionAdapter(this));
jButton5.setToolTipText("退出系統(tǒng)"); jButton5.setText("退出系統(tǒng)"); this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jPanel2, BorderLayout.EAST);
jPanel2.add(jButton1, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
jPanel2.add(jButton2, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(9, 0, 0, 21), 0, 0));
jPanel2.add(jButton3, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 0, 0, 10), 0, 0));
jPanel2.add(jButton4, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 10, 0), 12, 0)); jPanel2.add(jButton5, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(13, 0, 0, 11), 21, 0));
}
class MyPanel
extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
imageIcon1.paintIcon(this, g, 0, 0);
}
}
void jButton4_actionPerformed(ActionEvent e) {
MainFrame.main( null );
this.hide();
}
}
class WelcomeFrame_jButton4_actionAdapter implements java.awt.event.ActionListener {
WelcomeFrame adaptee;
WelcomeFrame_jButton4_actionAdapter(WelcomeFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton4_actionPerformed(e);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -