?? xzsecretary.java
字號:
package com.xZon.secretary;
import javax.swing.*;
import java.awt.*;
import javax.swing.event.*;
import java.awt.event.*;
public class xZSecretary extends JFrame{
public xZSecretary(){
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
//javax.swing.UIManager.setLookAndFeel(
// "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}//界面設置為當前windows風格,體現在保存與打開文件
catch(Exception e){ }
showFace();
}
private void showFace(){
JPanel mainPanel;
mainPanel = (JPanel) this.getContentPane();
mainPanel.setLayout(null);
JPanel calendarPanel=new JPanel();
JPanel userPanel=new JPanel();
JPanel backlogPanel=new JPanel();
mainPanel.add(calendarPanel);
calendarPanel.setBounds(3,3,180,100);
mainPanel.add(userPanel);
userPanel.setBounds(3,200,180,100);
mainPanel.add(backlogPanel);
backlogPanel.setBounds(3,400,180,150);
calendarPanel.add(new JLabel("calendar"));
userPanel.add(new JLabel("user"));
backlogPanel.add(new JLabel("backlog"));
String userItems[]={"11","12","13"
};
JList userList=new JList(userItems);
userPanel.add(userList);
userList.setSelectedIndex(0);
userList.addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e){
}
});
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(screenSize.width-205,10);
System.out.println(screenSize.width+" "+screenSize.height);
this.setSize(200, 400);
//this.setResizable(false);
this.setTitle("Secretary");
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}//end showFace
public static void main(String[] args){
new xZSecretary();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -