📄 discdelwindow.java
字号:
/**
* @(#)DiscDelWindow.java
*
*
* @author
* @version 1.00 2008/5/21
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DiscDelWindow extends AppFrame{
Container c;
private GridBagLayout layout;
private GridBagConstraints constraints;
JButton test;
JButton ok ;
JButton cancel;
JLabel NameLabel;
JLabel Label1=new JLabel();
JLabel Label2=new JLabel();
JTextField NameField=new JTextField(12);
public DiscDelWindow() {
c=getContentPane();
layout=new GridBagLayout();
c.setLayout(layout);
constraints=new GridBagConstraints();
super.setTitle("删除碟片");
NameLabel=new JLabel("输入要删的片名");
test=new JButton("该片是否在借?");
ok =new JButton("删除");
ok.setEnabled(false);
cancel=new JButton("取消");
addComponent(NameLabel,0,0,1,2);
addComponent(NameField,2,0,1,2);
addComponent(Label1,2,0,1,2);
addComponent(test,4,0,1,2);
addComponent(Label2,5,0,1,2);
addComponent(ok,6,0,1,1);
addComponent(cancel,6,1,1,1);
c.setBackground(Color.LIGHT_GRAY);
setLocation(200,100);
setVisible(true);
}
private void addComponent( Component component,
int row, int column, int height,int width )
{
constraints.gridx = column;
constraints.gridy = row;
constraints.gridwidth = width;
constraints.gridheight = height;
layout.setConstraints( component,constraints);
c.add(component);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -