?? frame1.java~3~
字號:
package statusbar;import java.awt.*;import java.awt.event.*;import javax.swing.*;public class Frame1 extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); Scrollbar scrollbar1 = new Scrollbar(); Label label1 = new Label(); /**Construct the frame*/ public Frame1() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } /**Component initialization*/ private void jbInit() throws Exception { //setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]"))); contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); this.setResizable(false); this.setSize(new Dimension(192, 125)); this.setTitle("狀態(tài)欄演示程序"); scrollbar1.setOrientation(0); scrollbar1.addAdjustmentListener(new java.awt.event.AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { scrollbar1_adjustmentValueChanged(e); } }); label1.setText("label1"); contentPane.add(scrollbar1, BorderLayout.SOUTH); contentPane.add(label1, BorderLayout.CENTER); } /**Overridden so we can exit when window is closed*/ protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } void button1_actionPerformed(ActionEvent e) {label1.setText("You hava clicked button1"); } void button2_actionPerformed(ActionEvent e) {label1.setText("You hava clicked button2"); } void button3_actionPerformed(ActionEvent e) {label1.setText("You hava clicked button3"); } void button4_actionPerformed(ActionEvent e) {label1.setText("You hava clicked button4"); } void scrollbar1_adjustmentValueChanged(AdjustmentEvent e) { }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -