?? welcomeframe.java~4~
字號:
package traffic;import java.awt.*;import java.awt.event.*;import javax.swing.*;/** * <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 contentPane; JLabel jLabel1 = new JLabel(); JLabel jLabel2 = new JLabel(); JLabel jLabel3 = new JLabel(); JLabel jLabel4 = new JLabel(); //Construct the frame public welcomeFrame() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(null); this.setSize(new Dimension(400, 300)); this.setTitle("歡迎訪問"); jLabel1.setFont(new java.awt.Font("Serif", 1, 30)); jLabel1.setForeground(Color.blue); jLabel1.setHorizontalAlignment(SwingConstants.CENTER); jLabel1.setText("歡迎使用公交查詢系統"); jLabel1.setBounds(new Rectangle(0, 20, 400, 40)); jLabel2.setHorizontalAlignment(SwingConstants.CENTER); jLabel2.setText("版權:全網中心"); jLabel2.setBounds(new Rectangle(80, 133, 188, 31)); jLabel3.setText("開發者:石正貴"); jLabel3.setBounds(new Rectangle(98, 202, 171, 29)); jLabel4.setText("2003年9月8號"); jLabel4.setBounds(new Rectangle(115, 251, 121, 21)); contentPane.add(jLabel1, null); contentPane.add(jLabel2, null); contentPane.add(jLabel3, null); contentPane.add(jLabel4, null); } //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); } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -