📄 writescoreinfo.java
字号:
package jin.internalFrame;
import java.awt.*;
import javax.swing.*;
import jin.handler.*;
import jin.view.ButtonsPanel;
//学生学号、课程编号、学年、学期、成绩、教师编号、状态、备注
public class WriteScoreInfo extends JInternalFrame
{
private JLabel[] labels;
private JTextField[] fields;
private JPanel[] panels;
private ButtonsPanel buttonsPanel;
private JComboBox[] comboBoxs;
private JDesktopPane desktopPane;
private JFrame frame;
private String id;
public WriteScoreInfo(JFrame frame,JDesktopPane desktopPane,String id)
{
super("",true,true,true,true);
this.frame=frame;
this.desktopPane=desktopPane;
this.id=id;
labels=new JLabel[5];
fields=new JTextField[3];
panels=new JPanel[6];
comboBoxs=new JComboBox[2];
setLayout(new GridLayout(6,1));
String titles[]={"课程编号 ","学生学号 ","分数 ","状态 ","备注 "
};
for(int i=0;i<5;i++)
{
panels[i]=new JPanel();
labels[i]=new JLabel(titles[i]);
panels[i].add(labels[i]);
if(i<=1)
{
comboBoxs[i]=new JComboBox();
panels[i].add(comboBoxs[i]);
}
if(i<=2)
{
fields[i]=new JTextField(6);
}
if(i>=2)
{
panels[i].add(fields[i-2]);
}
add(panels[i]);
}
comboBoxs[0].addItem("请选择");
buttonsPanel=new ButtonsPanel(2);
String str[]={"确定","取消"
};
buttonsPanel.setTitles(str);
panels[5]=new JPanel();
panels[5].add(buttonsPanel);
add(panels[5]);
desktopPane.add(this);
frame.add(desktopPane);
WriteScoreInfoHandler handler=new WriteScoreInfoHandler(this,id);
this.setSize(350,340);
this.setVisible(true);
}
public JTextField getField(int index)
{
return fields[index];
}
public JTextField[] getFields()
{
return fields;
}
public ButtonsPanel getButtonsPanel()
{
return buttonsPanel;
}
public JComboBox[] getComboBoxs()
{
return comboBoxs;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -