📄 updateclassinfo.java
字号:
package jin.internalFrame;
import java.awt.*;
import javax.swing.*;
import jin.handler.*;
import jin.view.ButtonsPanel;
public class UpdateClassInfo extends JInternalFrame
{
private JLabel[] labels;
private JComboBox[] comboBoxs;
private JTextField field;
private ButtonsPanel buttonsPanel;
private JPanel[] panels;
private JDesktopPane desktopPane;
private JFrame frame;
public UpdateClassInfo(JFrame frame,JDesktopPane desktopPane)
{
super("",true,true,true,true);
this.frame=frame;
this.desktopPane=desktopPane;
labels=new JLabel[3];
field=new JTextField(8);
comboBoxs=new JComboBox[2];
for(int i=0;i<2;i++)
{
comboBoxs[i]=new JComboBox();
}
comboBoxs[1].addItem("请选择");
comboBoxs[1].addItem("班级名称");
comboBoxs[1].addItem("专业编号");
comboBoxs[1].addItem("状态");
buttonsPanel=new ButtonsPanel(1);
buttonsPanel.setTitle(0,"确定");
panels=new JPanel[4];
String titles[]={"请选择要修改的班级编号","请选择要修改的项 ","请输入新值 "
};
for(int i=0;i<3;i++)
{
labels[i]=new JLabel(titles[i]);
panels[i]=new JPanel();
panels[i].add(labels[i]);
}
panels[0].add(comboBoxs[0]);
panels[1].add(comboBoxs[1]);
panels[2].add(field);
panels[3]=new JPanel();
panels[3].add(buttonsPanel);
this.setLayout(new GridLayout(4,1));
for(int i=0;i<4;i++)
{
add(panels[i]);
}
desktopPane.add(this);
frame.add(desktopPane);
UpdateClassInfoHandler handler=new UpdateClassInfoHandler(this);
this.setSize(350,250);
this.setVisible(true);
}
public static void main(String args[])
{
JFrame frame=new JFrame();
JDesktopPane desktopPane=new JDesktopPane();
UpdateClassInfo app=new UpdateClassInfo(frame,desktopPane);
frame.setSize(500,500);
frame.setVisible(true);
}
public JTextField getField()
{
return field;
}
public JComboBox[] getComboBoxs()
{
return comboBoxs;
}
public ButtonsPanel getButtonsPanel()
{
return buttonsPanel;
}
public JPanel getPanel()
{
return panels[2];
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -