📄 delopencourseinfo.java
字号:
package jin.internalFrame;
import java.awt.*;
import javax.swing.*;
import jin.handler.*;
import jin.view.ButtonsPanel;
//7.开课信息
//开课编号、课程编号、开课学年、开课学期、教师编号
public class DelOpenCourseInfo extends JInternalFrame
{
private JLabel label;
//private JTextField field;
private JPanel[] panels;
private ButtonsPanel buttonsPanel;
private JComboBox comboBox;
private JDesktopPane desktopPane;
private JFrame frame;
private String id;
public DelOpenCourseInfo(JFrame frame,JDesktopPane desktopPane,String id)
{
super("",true,true,true,true);
this.frame=frame;
this.desktopPane=desktopPane;
this.id=id;
label=new JLabel("请选择要删除的课程编号");
panels=new JPanel[2];
comboBox=new JComboBox();
comboBox.addItem("请选择");
panels[0]=new JPanel();
panels[0].add(label);
panels[0].add(comboBox);
setLayout(new GridLayout(2,1));
buttonsPanel=new ButtonsPanel(2);
String str[]={"确定","取消"
};
buttonsPanel.setTitles(str);
panels[1]=new JPanel();
panels[1].add(buttonsPanel);
add(panels[0]);
add(panels[1]);
/*
String titles[]={"请选择要删除的课程编号","学生学号","要修改的项","请输入新值"
};
for(int i=0;i<3;i++)
{
panels[i]=new JPanel();
labels[i]=new JLabel(titles[i]);
panels[i].add(labels[i]);
comboBoxs[i]=new JComboBox();
panels[i].add(comboBoxs[i]);
add(panels[i]);
}
comboBoxs[0].addItem("请选择");
comboBoxs[2].addItem("请选择");
comboBoxs[2].addItem("成绩");
comboBoxs[2].addItem("状态");
comboBoxs[2].addItem("备注");
labels[3]=new JLabel(titles[3]);
panels[3]=new JPanel();
panels[3].add(labels[3]);
field=new JTextField(6);
panels[3].add(field);
add(panels[3]);
buttonsPanel=new ButtonsPanel(2);
String str[]={"确定","取消"
};
buttonsPanel.setTitles(str);
panels[4]=new JPanel();
panels[4].add(buttonsPanel);
add(panels[4]);
*/
desktopPane.add(this);
frame.add(desktopPane);
DelOpenCourseInfoHandler handler=new DelOpenCourseInfoHandler(this,id);
this.setSize(280,170);
this.setVisible(true);
}
public ButtonsPanel getButtonsPanel()
{
return buttonsPanel;
}
public JComboBox getComboBox()
{
return comboBox;
}
public static void main(String args[])
{
JFrame frame=new JFrame();
JDesktopPane desktopPane=new JDesktopPane();
DelOpenCourseInfo app=new DelOpenCourseInfo(frame,desktopPane,"t002");
frame.setSize(500,500);
frame.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -