📄 discaddwindow.java
字号:
/**
* @(#)DiscAddWindow.java
*
*
* @author
* @version 1.00 2008/5/21
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DiscAddWindow extends AppFrame{
Container c;
private GridBagLayout layout;
private GridBagConstraints constraints;
JLabel UserQueryLabel[]=new JLabel[7];
JTextField NameField=new JTextField(12);
JTextField RoleField=new JTextField(12);
JTextField NumberField=new JTextField(12);
JTextField PriceField=new JTextField(12);
String names1[] = { "","大陆", "欧美", "日韩" ,"港台"};
JComboBox AreaBox = new JComboBox( names1 );
String names2[] = { "","2008", "2007", "2006","2005", "2004","2003", "2002","2001","2000以前"};
JComboBox TimeBox = new JComboBox( names2 );
String names3[] = { "","爱情", "科幻", "战争","动作","恐怖","悬疑","喜剧","综艺","卡通","电视剧"};
JComboBox TypeBox = new JComboBox( names3 );
JButton ok=new JButton("添加");
JButton cancel=new JButton("取消");
public DiscAddWindow() {
c=getContentPane();
layout=new GridBagLayout();
c.setLayout(layout);
constraints=new GridBagConstraints();
super.setTitle("碟片入库");
UserQueryLabel[0]=new JLabel("片名");
UserQueryLabel[1]=new JLabel("主演");
UserQueryLabel[2]=new JLabel("类型");
UserQueryLabel[3]=new JLabel("地区");
UserQueryLabel[4]=new JLabel("时间");
UserQueryLabel[5]=new JLabel("总数");
UserQueryLabel[6]=new JLabel("日租金");
addComponent(UserQueryLabel[0],0,0,1,1);
addComponent(UserQueryLabel[1],1,0,1,1);
addComponent(UserQueryLabel[2],2,0,1,1);
addComponent(UserQueryLabel[3],3,0,1,1);
addComponent(UserQueryLabel[4],4,0,1,1);
addComponent(UserQueryLabel[5],5,0,1,1);
addComponent(UserQueryLabel[6],6,0,1,1);
addComponent(NameField,0,1,1,1);
addComponent(RoleField,1,1,1,1);
addComponent(TypeBox,2,1,1,1);
addComponent(AreaBox,3,1,1,1);
addComponent(TimeBox,4,1,1,1);
addComponent(NumberField,5,1,1,1);
addComponent(PriceField,6,1,1,1);
addComponent(ok,7,0,1,1);
addComponent(cancel,7,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 + -