课程表查询系统
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
String s1,s2,s3,s4; s1 = ft.ch1.getSelectedItem(); s2 = ft.ch2.getSelectedItem(); s3 = ft.ch3.getSelectedItem(); s4 = s1.concat(s2).concat(s3); //--------------------------------------------- 大 一 一 班 的 课 程 --------------------------------------------------
} if(s4.equals("大一一班星期二")){
ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" +
"课程:" + class1[1] + "\t\t" + class1[0] + "\t" + class1[3] + "\n" + "教师:" + teacher1[1] + "\t\t" + teacher1[0] + "\t\t" + teacher1[3] + "\n" + "教室:" + address1[1] + "\t\t" + address1[0] + "\t\t" + address1[1])); } if(s4.equals("大一一班星期三")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[3] + "\t\t" + class1[4] + "\t\t" + "\n" + "教师:" + teacher1[3] + "\t\t" + teacher1[4] + "\t\t" + "\n" + "教室:" + address1[1] + "\t\t" + address1[2] + "\t\t")); } if(s4.equals("大一一班星期四")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[1] + "\t\t" + class1[5] + "\t\t" + class1[6] + "\n" + "教师:" + teacher1[1] + "\t\t" + " " + "\t\t" + teacher1[5] + "\n" + "教室:" + address1[1] + "\t\t" + " " + "\t\t" + address1[2])); } if(s4.equals("大一一班星期五")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[3] + "\t\t" + class1[3] + "\t\t" + class1[4] + "\n" + "教师:" + teacher1[3] + "\t\t" + teacher1[3] + "\t\t" + teacher1[4] + "\n" + "教室:" + address1[1] + "\t\t" + address1[1] + "\t\t" + address1[2])); } //------------------------------------------大一二班的课程--------------------------------------------String[] st2 = {"1~2","3~4","5~6"}; String[] class2 = {"C#","思修","计算机数学","web","英语","体育","创业"}; String[] teacher2 = {"陈晓华","柳俪葳","袁文景","王志花","罗丽","曹艳红"}; String[] address2 = {"二教 402","三教阶三","一中 101","一中 201"};
"教师:" + teacher2[2] + "\t\t" + teacher2[3] + "\t\t" + "\n" + "教室:" + address2[2] + "\t\t" + address2[1] + "\t\t"));
} if(s4.equals("大一二班星期三")){
ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
} if(s4.equals("大一二班星期四")){
ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
this.ft = ft; } /* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e){
bt.setBackground(Color.cyan);
bt.addActionListener(new MyListener(this)); //注册事件监听器 ch1.addItemListener(new ChoiceHandler1()); //注册事件监听器
ch2.addItemListener(new ChoiceHandler2()); ch3.addItemListener(new ChoiceHandler3());
if(s4.equals("大一二班星期一")){ ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
"\n" +
"课程:" + class2[0] + "\t\t" + class2[0] + "\t\t" + class2[1] + "\n" + "教师:" + teacher2[0] + "\t\t" + teacher2[0] + "\t\t" + teacher2[1] + "\n" + "教室:" + address2[0] + "\t\t" + address2[0] + "\t\t" + address2[1]));
//注册事件监听器 //注册事件监听器
ቤተ መጻሕፍቲ ባይዱ
add(ch1);add(ch2);add(ch3);add(bt);add(tf1);
//setLayout(null);
setVisible(true); } }
package number1;
import java.awt.event.*;
public class MyListener implements ActionListener{ private First ft; public MyListener(First ft){
//创建下拉列表框
static Choice ch2 = new Choice();
static Choice ch3 = new Choice();
TextArea tf1 = new TextArea();
//创建文本框
public static void main(String[] args) {
}
if(s4.equals("大一二班星期二")){ ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
"\n" +
"课程:" + class2[2] + "\t" + class2[3] + "\n" +
String[] st = {"1~2","3~4","5~6"}; String[] class1 = {"计算机数学","web","思修","C#","英语","体育","创业"}; String[] teacher1 = {"钱志娟","王志花","柳俪葳","马莎","罗丽","曹艳红"}; String[] address1 = {"一中 201","二教 308","三教阶三"};
//设置窗体左上角的位置
test.setTitle("软件系课程查询系统");
test.addWindowListener(new WindowHandler()); //注册事件监听器
}
public void operation(){
ch1 = new Choice();
ch2 = new Choice();
// TODO Auto-generated method stub
First test = new First();
test.operation();
test.setBackground(Color.cyan); //设置窗体颜色
test.setSize(500,300);
//设置窗体的大小
test.setLocation(500,200);
ch3 = new Choice();
tf1 = new TextArea();
//设置年级按钮 ch1.add("大一"); ch1.add("大二"); //设置班级按钮 ch2.add("一班");ch2.add("二班"); ch2.add("三班");ch2.add("四班"); ch2.add("五班");ch2.add("六班");
if(s4.equals("大一一班星期一")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[0] + "\t" + class1[1] + "\t\t" + class1[2] + "\n" + "教师:" + teacher1[0] + "\t\t" + teacher1[1] + "\t\t" + teacher1[2] + "\n" + "教室:" + address1[0] + "\t\t" + address1[1] + "\t\t" + address1[2]));
课程表
——史慧智 这是我大一第二学期时间做的课程表查询系统,学习 java 两个月,大家给点意见,谢 谢。
package number1;
import java.awt.*;
public class First extends Frame {
/**
* @param args
* 声明全局变量
*/
static Choice ch1 = new Choice();
//设置星期按钮 ch3.add("星期一");ch3.add("星期二"); ch3.add("星期三");ch3.add("星期四"); ch3.add("星期五");
setLayout(new FlowLayout()); //采用流式布局管理器
Button bt = new Button("查询");
"\n" +
"课程:" + class2[3] + "\t\t" + class2[4] + "\t\t" + class2[3] + "\n" +
"教师:" + teacher2[3] + "\t\t" + teacher2[4] + "\t\t" + class2[3] + "\n" + "教室:" + address2[0] + "\t\t" + address2[1] + "\t\t" + address2[0]));
} if(s4.equals("大一一班星期二")){
ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" +
"课程:" + class1[1] + "\t\t" + class1[0] + "\t" + class1[3] + "\n" + "教师:" + teacher1[1] + "\t\t" + teacher1[0] + "\t\t" + teacher1[3] + "\n" + "教室:" + address1[1] + "\t\t" + address1[0] + "\t\t" + address1[1])); } if(s4.equals("大一一班星期三")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[3] + "\t\t" + class1[4] + "\t\t" + "\n" + "教师:" + teacher1[3] + "\t\t" + teacher1[4] + "\t\t" + "\n" + "教室:" + address1[1] + "\t\t" + address1[2] + "\t\t")); } if(s4.equals("大一一班星期四")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[1] + "\t\t" + class1[5] + "\t\t" + class1[6] + "\n" + "教师:" + teacher1[1] + "\t\t" + " " + "\t\t" + teacher1[5] + "\n" + "教室:" + address1[1] + "\t\t" + " " + "\t\t" + address1[2])); } if(s4.equals("大一一班星期五")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[3] + "\t\t" + class1[3] + "\t\t" + class1[4] + "\n" + "教师:" + teacher1[3] + "\t\t" + teacher1[3] + "\t\t" + teacher1[4] + "\n" + "教室:" + address1[1] + "\t\t" + address1[1] + "\t\t" + address1[2])); } //------------------------------------------大一二班的课程--------------------------------------------String[] st2 = {"1~2","3~4","5~6"}; String[] class2 = {"C#","思修","计算机数学","web","英语","体育","创业"}; String[] teacher2 = {"陈晓华","柳俪葳","袁文景","王志花","罗丽","曹艳红"}; String[] address2 = {"二教 402","三教阶三","一中 101","一中 201"};
"教师:" + teacher2[2] + "\t\t" + teacher2[3] + "\t\t" + "\n" + "教室:" + address2[2] + "\t\t" + address2[1] + "\t\t"));
} if(s4.equals("大一二班星期三")){
ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
} if(s4.equals("大一二班星期四")){
ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
this.ft = ft; } /* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e){
bt.setBackground(Color.cyan);
bt.addActionListener(new MyListener(this)); //注册事件监听器 ch1.addItemListener(new ChoiceHandler1()); //注册事件监听器
ch2.addItemListener(new ChoiceHandler2()); ch3.addItemListener(new ChoiceHandler3());
if(s4.equals("大一二班星期一")){ ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
"\n" +
"课程:" + class2[0] + "\t\t" + class2[0] + "\t\t" + class2[1] + "\n" + "教师:" + teacher2[0] + "\t\t" + teacher2[0] + "\t\t" + teacher2[1] + "\n" + "教室:" + address2[0] + "\t\t" + address2[0] + "\t\t" + address2[1]));
//注册事件监听器 //注册事件监听器
ቤተ መጻሕፍቲ ባይዱ
add(ch1);add(ch2);add(ch3);add(bt);add(tf1);
//setLayout(null);
setVisible(true); } }
package number1;
import java.awt.event.*;
public class MyListener implements ActionListener{ private First ft; public MyListener(First ft){
//创建下拉列表框
static Choice ch2 = new Choice();
static Choice ch3 = new Choice();
TextArea tf1 = new TextArea();
//创建文本框
public static void main(String[] args) {
}
if(s4.equals("大一二班星期二")){ ft.tf1.setText(String.valueOf("课时:" + st2[0] + "\t\t" + st2[1] + "\t\t" + st2[2] + "\t\t" +
"\n" +
"课程:" + class2[2] + "\t" + class2[3] + "\n" +
String[] st = {"1~2","3~4","5~6"}; String[] class1 = {"计算机数学","web","思修","C#","英语","体育","创业"}; String[] teacher1 = {"钱志娟","王志花","柳俪葳","马莎","罗丽","曹艳红"}; String[] address1 = {"一中 201","二教 308","三教阶三"};
//设置窗体左上角的位置
test.setTitle("软件系课程查询系统");
test.addWindowListener(new WindowHandler()); //注册事件监听器
}
public void operation(){
ch1 = new Choice();
ch2 = new Choice();
// TODO Auto-generated method stub
First test = new First();
test.operation();
test.setBackground(Color.cyan); //设置窗体颜色
test.setSize(500,300);
//设置窗体的大小
test.setLocation(500,200);
ch3 = new Choice();
tf1 = new TextArea();
//设置年级按钮 ch1.add("大一"); ch1.add("大二"); //设置班级按钮 ch2.add("一班");ch2.add("二班"); ch2.add("三班");ch2.add("四班"); ch2.add("五班");ch2.add("六班");
if(s4.equals("大一一班星期一")){ ft.tf1.setText(String.valueOf("课时:" + st[0] + "\t\t" + st[1] + "\t\t" + st[2] + "\t\t" + "\n" + "课程:" + class1[0] + "\t" + class1[1] + "\t\t" + class1[2] + "\n" + "教师:" + teacher1[0] + "\t\t" + teacher1[1] + "\t\t" + teacher1[2] + "\n" + "教室:" + address1[0] + "\t\t" + address1[1] + "\t\t" + address1[2]));
课程表
——史慧智 这是我大一第二学期时间做的课程表查询系统,学习 java 两个月,大家给点意见,谢 谢。
package number1;
import java.awt.*;
public class First extends Frame {
/**
* @param args
* 声明全局变量
*/
static Choice ch1 = new Choice();
//设置星期按钮 ch3.add("星期一");ch3.add("星期二"); ch3.add("星期三");ch3.add("星期四"); ch3.add("星期五");
setLayout(new FlowLayout()); //采用流式布局管理器
Button bt = new Button("查询");
"\n" +
"课程:" + class2[3] + "\t\t" + class2[4] + "\t\t" + class2[3] + "\n" +
"教师:" + teacher2[3] + "\t\t" + teacher2[4] + "\t\t" + class2[3] + "\n" + "教室:" + address2[0] + "\t\t" + address2[1] + "\t\t" + address2[0]));