📄 strselpan.java
字号:
package util4;import javax.swing.*;import java.awt.*;import util2.*;import util3.*;public class StrSelPan extends JDialog{ JPanel jPanel1 = new JPanel(); GridBagLayout gridBagLayout1 = new GridBagLayout(); JLabel lab1 = new JLabel(); JTextField tf = new JTextField(); JLabel nulLab1 = new JLabel(); JButton cancelBut = new JButton(); JButton okBut = new JButton(); public StrSelPan(Frame frame,String title,boolean modal) { super(frame,title,modal); try{jbInit();} catch(Exception e){e.printStackTrace();} } private void jbInit() throws Exception { jPanel1.setLayout(gridBagLayout1); lab1.setFont(new java.awt.Font("Dialog", 1, 14)); lab1.setText("String to find : "); tf.setFont(new java.awt.Font("Dialog", 0, 14)); tf.setCaretPosition(0); tf.setText(" "); nulLab1.setFont(new java.awt.Font("Dialog", 1, 18)); nulLab1.setText(" "); cancelBut.setActionCommand("cancelBut"); cancelBut.setText("Cancel"); okBut.setActionCommand("okBut"); okBut.setText("OK"); this.getContentPane().add(jPanel1, BorderLayout.CENTER); jPanel1.add(lab1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(tf, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(nulLab1, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(cancelBut, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 55, 0, 15), 0, 0)); jPanel1.add(okBut, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 19, 0)); tf.setColumns(20); } public static void main(String[] arg){ JFrame jf=new JFrame("try"); jf.setBounds(200,200,200,200); StrSelPan ssp=new StrSelPan(jf,"Find string",false); ssp.setBounds(250,250,400,150); jf.show(); ssp.show(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -