谁会写这个JAVA Swing界面的代码?非常感谢
展开全部
我做了个大概,不过对你应该有所帮助。
package com;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class JSwingDemo extends JFrame {
/**
* @param args
*/
private JPanel panel1;
private JPanel panel2;
private JPanel panel3;
private JPanel panel4;
private JPanel panel5;
private JButton btn1;
private JButton btn2;
private JButton btn3;
private JButton btn4;
private JLabel label1;
private JLabel label2;
private JTextField jtField;
public JSwingDemo(){
setTitle("学生成绩管理系统");
setSize(900,600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
panel1=new JPanel();
panel2=new JPanel();
panel3=new JPanel();
panel4=new JPanel();
panel5=new JPanel();
btn1=new JButton("查询");
btn2=new JButton("添加");
btn3=new JButton("删除");
btn4=new JButton("修改");
label1=new JLabel("查询条件:学号");
label2=new JLabel("表格形式显示数据区域");
jtField=new JTextField(10);
panel1.setBorder(new EtchedBorder(EtchedBorder.RAISED));
panel1.add(label1);
panel1.add(jtField);
panel1.add(btn1);
panel2.add(btn2);
panel2.add(btn3);
panel2.add(btn4);
panel2.setBorder(new EtchedBorder(EtchedBorder.RAISED));
panel3.setLayout(new BorderLayout());
panel3.add(panel1,BorderLayout.NORTH);
panel3.add(panel2,BorderLayout.SOUTH);
panel5.add(label2);
panel3.add(panel5,BorderLayout.CENTER);
panel3.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED),"系统工作区"));
//panel3.setTitle("系统工作区");
panel3.setSize(648, 600);
panel4.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED),"系统功能导航树"));
panel4.setSize(250, 600);
//setLayout(new FlowLayout());
add(panel4);
add(panel3);
setVisible(true);
//pack();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new JSwingDemo();
}
}
package com;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
public class JSwingDemo extends JFrame {
/**
* @param args
*/
private JPanel panel1;
private JPanel panel2;
private JPanel panel3;
private JPanel panel4;
private JPanel panel5;
private JButton btn1;
private JButton btn2;
private JButton btn3;
private JButton btn4;
private JLabel label1;
private JLabel label2;
private JTextField jtField;
public JSwingDemo(){
setTitle("学生成绩管理系统");
setSize(900,600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
panel1=new JPanel();
panel2=new JPanel();
panel3=new JPanel();
panel4=new JPanel();
panel5=new JPanel();
btn1=new JButton("查询");
btn2=new JButton("添加");
btn3=new JButton("删除");
btn4=new JButton("修改");
label1=new JLabel("查询条件:学号");
label2=new JLabel("表格形式显示数据区域");
jtField=new JTextField(10);
panel1.setBorder(new EtchedBorder(EtchedBorder.RAISED));
panel1.add(label1);
panel1.add(jtField);
panel1.add(btn1);
panel2.add(btn2);
panel2.add(btn3);
panel2.add(btn4);
panel2.setBorder(new EtchedBorder(EtchedBorder.RAISED));
panel3.setLayout(new BorderLayout());
panel3.add(panel1,BorderLayout.NORTH);
panel3.add(panel2,BorderLayout.SOUTH);
panel5.add(label2);
panel3.add(panel5,BorderLayout.CENTER);
panel3.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED),"系统工作区"));
//panel3.setTitle("系统工作区");
panel3.setSize(648, 600);
panel4.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED),"系统功能导航树"));
panel4.setSize(250, 600);
//setLayout(new FlowLayout());
add(panel4);
add(panel3);
setVisible(true);
//pack();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new JSwingDemo();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询