?? crmsbuttonbar.java
字號:
package crms.ui;import javax.swing.*;import java.awt.*;public class CRMSButtonBar extends JPanel { JPanel left = null; JPanel middle = null; JPanel right = null; public static final int LEFT = 0; public static final int MIDDLE = 1; public static final int RIGHT = 2; public CRMSButtonBar() { left = new JPanel(new FlowLayout(FlowLayout.LEFT)); middle = new JPanel(new FlowLayout(FlowLayout.CENTER)); right = new JPanel(new FlowLayout(FlowLayout.RIGHT)); setLayout(new BorderLayout()); add(left, BorderLayout.WEST); add(middle, BorderLayout.CENTER); add(right, BorderLayout.EAST); setBackground(Color.WHITE); } public void setBackground(Color color) { super.setBackground(color); // handle the pre-init thing if (left == null) { return; } left.setBackground(color); middle.setBackground(color); right.setBackground(color); } public void addButton(int pos, JButton button) { JPanel p = null; switch (pos) { case LEFT: p = left; break; case MIDDLE: p = middle; break; case RIGHT: p = right; break; } if (p != null) { p.add(button); //p.setVisible(true); } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -