📄 templatepane.java
字号:
/* * TemplatePane.java * * Created on 23. oktober 2005, 15:20 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package backup.client;import java.lang.*;import javax.swing.*;import javax.swing.border.*;import java.awt.*;import java.awt.event.*;import java.util.*;/** * * @author Kim Stenbo Nielsen */abstract class TemplatePane extends JPanel implements ActionListener { public TitledBorder border; public JComponent topPane; public JComponent centerPane; public JComponent buttonPane; public JButton leftButton; public JButton middleButton; public JButton rightButton; public TemplatePane() { border = BorderFactory.createTitledBorder(""); // create top pane topPane = new JPanel(); // create center pane centerPane = new JPanel(); centerPane.setBorder(border); // create button pane with two buttons JPanel buttonPane = new JPanel(); buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); buttonPane.setBorder(BorderFactory.createEmptyBorder(10,0,0,0)); leftButton = new JButton("Cancel"); leftButton.addActionListener(this); middleButton = new JButton("Yes"); middleButton.addActionListener(this); rightButton = new JButton("No"); rightButton.addActionListener(this); buttonPane.add(Box.createHorizontalGlue()); buttonPane.add(Box.createRigidArea(new Dimension(100,0))); buttonPane.add(leftButton); buttonPane.add(Box.createRigidArea(new Dimension(5,0))); buttonPane.add(middleButton); buttonPane.add(Box.createRigidArea(new Dimension(5,0))); buttonPane.add(rightButton); // finalize the panel template setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(15,15,15,15)); add(topPane, BorderLayout.PAGE_START); add(buttonPane, BorderLayout.PAGE_END); add(centerPane, BorderLayout.CENTER); } public TemplatePane(String title) { this(); border.setTitle(title); } public void setTitle(String title) { border.setTitle(title); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -