📄 c0c644fc92560019109f97d84330f2ed
字号:
import java.awt.*;
import java.awt.event.*;
public class InputGoods implements ActionListener {
GeneralFrame inputFrame = new GeneralFrame("货物输入");
Label idLabel, typeLabel, recordNameLabel, singerLabel, priceLabel, dateLabel;
TextField idText, typeText, recordNameText, singerText, priceText, dateText;
Button OKButton;
Panel firstPanel_1,firstPanel_2;
public InputGoods() {
inputFrame.setSize(480,130);
inputFrame.setResizable(false);
idLabel = new Label("编号");
typeLabel = new Label("类型");
recordNameLabel = new Label("专辑名字");
singerLabel = new Label("歌手");
priceLabel = new Label("单价");
dateLabel = new Label(" 日期 ");
idText = new TextField(12);
typeText = new TextField(12);
recordNameText = new TextField(12);
singerText = new TextField(12);
priceText = new TextField(12);
dateText = new TextField(12);
firstPanel_1=new Panel();
firstPanel_2=new Panel();
OKButton =new Button(" 确定 ");
inputFrame.setLayout(new BorderLayout()); //布局管理
inputFrame.add(firstPanel_1,BorderLayout.CENTER);
inputFrame.add(firstPanel_2,BorderLayout.SOUTH);
firstPanel_1.setLayout(new FlowLayout(FlowLayout.LEFT));
firstPanel_1.add(idLabel);
firstPanel_1.add(idText);
firstPanel_1.add(typeLabel);
firstPanel_1.add(typeText);
firstPanel_1.add(recordNameLabel);
firstPanel_1.add(recordNameText);
firstPanel_1.add(singerLabel);
firstPanel_1.add(singerText);
firstPanel_1.add(priceLabel);
firstPanel_1.add(priceText);
firstPanel_1.add(dateLabel);
firstPanel_1.add(dateText);
firstPanel_2.setLayout(new FlowLayout(FlowLayout.CENTER));
firstPanel_2.add(OKButton);
OKButton.addActionListener(this);
}
void showInputFrame() {
inputFrame.show();
}
public void actionPerformed(ActionEvent event){ //菜单事件处理
String eventName;
eventName=event.getActionCommand();
if(eventName.equals(" 确定 "))
{
DataIO o=new DataIO();
o.dataOutput(this,new Music());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -