TeacherUI modify

This commit is contained in:
cccccyb
2022-06-09 14:34:21 +08:00
parent c265a1bc0f
commit dcadc2c9b3
16 changed files with 1361 additions and 35 deletions

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.Attendance">
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="8b1cc" binding="tabbedPane1" default-binding="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<tabLayoutPolicy value="0"/>
<tabPlacement value="1"/>
</properties>
<border type="bevel-lowered" title="今日考勤" title-justification="2" title-position="2">
<font name="Microsoft YaHei" size="22" style="1"/>
<title-color color="-10128709"/>
</border>
<children>
<scrollpane id="cc3fa">
<constraints>
<tabbedpane title="已签"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="8aba9" class="javax.swing.JTable" binding="table_already">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
<scrollpane id="c322c">
<constraints>
<tabbedpane title="未签"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="6cfbd" class="javax.swing.JTable" binding="table_undo">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
</children>
</tabbedpane>
<component id="babc6" class="javax.swing.JLabel" binding="test">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="20" style="1"/>
<text value=""/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -0,0 +1,71 @@
package com.cfive.classroom.teacher;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.*;
import java.awt.event.ComponentAdapter;
public class Attendance {
private static final Attendance attendance=new Attendance();
private static final JFrame frame = new JFrame("考勤情况");
private JPanel rootPanel;
private JTabbedPane tabbedPane1;
private Object[] t1_columnTitle = {"学号" , "姓名" , "签到时间"};
private Object[] t2_columnTitle={"学号","姓名","签到状态"};
private Object[][] data={{"a","b","c"},{"d","e","f"},{"1","2","3"}};
private JTable table_already;
private JTable table_undo;
private JLabel test;
private static final Logger LOGGER= LogManager.getLogger();
public Attendance() {
table_undo.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
int row = table_undo.getSelectedRow();
// int col = table_undo.getSelectedColumn();
String newString=table_undo.getValueAt(row,2).toString();
attendance.test.setText(newString);
LOGGER.info(newString);
}
});
}
public static void main(String[] args) {
frame.setContentPane(attendance.rootPanel);
frame.setBounds(600,400,600,400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(false);
}
public void start(){
frame.setContentPane(attendance.rootPanel);
frame.setBounds(600,400,600,400);
frame.setResizable(false);
DefaultTableModel alreadyTableModel=new DefaultTableModel(data,t1_columnTitle);
alreadyTableModel.setColumnCount(3);
attendance.table_already.setModel(alreadyTableModel);
DefaultTableModel undoTableModel=new DefaultTableModel(data,t2_columnTitle);
undoTableModel.setColumnCount(3);
attendance.table_undo.setModel(undoTableModel);
attendance.table_undo.setCellSelectionEnabled(true);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setVisible(true);
}
}

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.ChangePassword">
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="50" left="50" bottom="20" right="50"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="e991" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="30" bottom="0" right="30"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="33bcc" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="688da" class="javax.swing.JButton" binding="cancel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="取消"/>
</properties>
</component>
</children>
</grid>
<grid id="6e5ab" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="5e701" class="javax.swing.JButton" binding="confirm">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="确认"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="5650f" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="c0f31" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="120" height="74"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="27845" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="工号"/>
</properties>
</component>
<component id="6c476" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="新密码"/>
</properties>
</component>
<component id="11d34" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="确认密码"/>
</properties>
</component>
</children>
</grid>
<grid id="afeb6" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="50"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="4802a" class="javax.swing.JTextField" binding="workNo">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="b49fe" class="javax.swing.JPasswordField" binding="passwordField1" default-binding="true">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="4d8af" class="javax.swing.JPasswordField" binding="passwordField2" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,56 @@
package com.cfive.classroom.teacher;
import javax.swing.*;
public class ChangePassword {
private JPanel rootPanel;
private JTextField workNo;
private JButton cancel;
private JButton confirm;
private JPasswordField passwordField1;
private JPasswordField passwordField2;
static JFrame frame = new JFrame("ChangePassword");
public ChangePassword() {
confirm.addActionListener(e -> {
if(check()){
//将修改后的密码在数据表修改
frame.dispose();
}
});
cancel.addActionListener(e -> {
frame.dispose();
});
}
public static void main(String[] args) {
frame.setContentPane(new ChangePassword().rootPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(600,400);
frame.setVisible(false);
}
public void start() {
frame.setContentPane(new ChangePassword().rootPanel);
frame.setSize(600,400);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
// frame.pack();
frame.setVisible(true);
}
private boolean check() {
String password1,password2;
password1 = String.valueOf(passwordField1.getPassword());
password2 = String.valueOf(passwordField2.getPassword());
if (password1.length()==0 || password2.length()==0) {
JOptionPane.showMessageDialog(null,"输入的密码为空");
return false;
} else if (password1.equals(password2) == false) {
JOptionPane.showMessageDialog(null, "两次输入密码不同");
return false;
} else return true;
}
}

View File

@@ -0,0 +1,218 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.CheckIn">
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="782" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="987d9" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="3621c" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="1494c" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="20" style="1"/>
<text value="请输入四位签到码"/>
</properties>
</component>
<hspacer id="7ef14">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="c54a3">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
<grid id="a327d" layout-manager="GridLayoutManager" row-count="3" column-count="8" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="30" bottom="0" right="30"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="6eddb" class="javax.swing.JTextField" binding="textField1" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="2" indent="0" use-parent-layout="false">
<preferred-size width="100" height="100"/>
</grid>
</constraints>
<properties>
<columns value="1"/>
<font size="72" style="1"/>
<text value=""/>
</properties>
</component>
<component id="44815" class="javax.swing.JTextField" binding="textField3" default-binding="true">
<constraints>
<grid row="1" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="2" indent="0" use-parent-layout="false">
<preferred-size width="100" height="100"/>
</grid>
</constraints>
<properties>
<columns value="1"/>
<font size="72" style="1"/>
</properties>
</component>
<component id="930fd" class="javax.swing.JTextField" binding="textField4" default-binding="true">
<constraints>
<grid row="1" column="6" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="2" indent="0" use-parent-layout="false">
<preferred-size width="100" height="100"/>
</grid>
</constraints>
<properties>
<columns value="1"/>
<font size="72" style="1"/>
</properties>
</component>
<component id="3cb39" class="javax.swing.JTextField" binding="textField2" default-binding="true">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="2" indent="0" use-parent-layout="false">
<preferred-size width="100" height="100"/>
</grid>
</constraints>
<properties>
<columns value="1"/>
<font size="72" style="1"/>
</properties>
</component>
<hspacer id="b6ba1">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="77c95">
<constraints>
<grid row="1" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="b9">
<constraints>
<grid row="1" column="5" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="632d3">
<constraints>
<grid row="1" column="7" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<vspacer id="86480">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="85a13">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="d83e8">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="dd6bd">
<constraints>
<grid row="0" column="4" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="a3d98">
<constraints>
<grid row="0" column="6" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="2636b">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="d9cc2">
<constraints>
<grid row="2" column="4" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="a0cc4">
<constraints>
<grid row="2" column="6" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
<grid id="d016a" layout-manager="GridLayoutManager" row-count="1" column-count="7" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="40237" class="javax.swing.JButton" binding="bt_confim">
<constraints>
<grid row="0" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="确定"/>
</properties>
</component>
<hspacer id="3ed49">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="a0a17">
<constraints>
<grid row="0" column="6" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="d815d">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="e4655" class="javax.swing.JButton" binding="bt_cancel">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="取消"/>
</properties>
</component>
<hspacer id="eb380">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="e9d54">
<constraints>
<grid row="0" column="5" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,91 @@
package com.cfive.classroom.teacher;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class CheckIn {
private static final CheckIn checkIn=new CheckIn();
private static final JFrame frame= new JFrame("发布签到码");
private JPanel rootPanel;
private JTextField textField1;
private JTextField textField2;
private JTextField textField3;
private JTextField textField4;
private JButton bt_confim;
private JButton bt_cancel;
private String n1,n2,n3,n4,number;
private static final Logger LOGGER= LogManager.getLogger();
public CheckIn() {
//限制签到码的长度
bt_cancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
frame.setVisible(false);
}
});
textField1.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
n1=textField1.getText();
if(n1.length()>=1){
e.consume();
}
}
});
textField2.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
n2=textField2.getText();
if(n2.length()>=1){
e.consume();
}
}
});
textField3.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
n3=textField3.getText();
if(n3.length()>=1){
e.consume();
}
}
});textField4.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
n4=textField4.getText();
if(n4.length()>=1){
e.consume();
}
}
});
//确定按钮的点击事件
bt_confim.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
number=n1+n2+n3+n4;
LOGGER.info(number);
}
});
}
public static void main(String[] args) {
frame.setContentPane(checkIn.rootPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(false);
}
public void start(){
frame.setContentPane(checkIn.rootPanel);
frame.setBounds(600,400,600,400);
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.ClassList">
<grid id="27dc6" binding="rootPanel1" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="450"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="1133d" binding="selectPanel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="f5e2c" class="javax.swing.JComboBox" binding="comboBox">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="10" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="24" style="0"/>
</properties>
</component>
<component id="a7310" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="4" hsize-policy="0" anchor="2" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="31" height="68"/>
</grid>
</constraints>
<properties>
<font name="Microsoft YaHei" size="28" style="1"/>
<text value="选择您所要进入的班级"/>
</properties>
</component>
<vspacer id="3777c">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
<grid id="8f8f6" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="22b87" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="b374c" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="50" bottom="0" right="50"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="bae0" class="javax.swing.JButton" binding="Button1">
<constraints>
<grid row="0" column="1" row-span="2" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="129" height="30"/>
</grid>
</constraints>
<properties>
<text value="进入"/>
</properties>
</component>
<hspacer id="a263b">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="1069">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
<grid id="2bffc" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,48 @@
package com.cfive.classroom.teacher;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
public class ClassList {
private static final ClassList classlist=new ClassList();
private static JFrame frame = new JFrame("课堂互动通-教师端");
private JPanel rootPanel1;
private JButton Button1;
private JComboBox comboBox;
private JPanel selectPanel;
private String workerNo,className;
public ClassList() {
Button1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
className=(String) classlist.comboBox.getSelectedItem();
Main.start(classlist.workerNo,classlist.className);
frame.setVisible(false);
}
});
}
public static void main(String[] args) {
frame.setContentPane(classlist.rootPanel1);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(false);
}
public void start(String workerNo){
frame.setContentPane(classlist.rootPanel1);
frame.setSize(600,400);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
classlist.workerNo=workerNo;
classlist.comboBox.addItem("20软工3班");
classlist.comboBox.addItem("20软工4班");
classlist.comboBox.addItem("20软工5班");
classlist.comboBox.addItem("20软工6班");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

View File

@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.Main">
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="50" left="50" bottom="50" right="50"/>
<constraints>
<xy x="20" y="20" width="502" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="a553a" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="15bf1" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="20" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="c9e8c" class="javax.swing.JTextField" binding="className">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="9" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
<font name="Microsoft YaHei" size="24"/>
</properties>
</component>
<component id="1fa72" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="24" style="1"/>
<text value="班级:"/>
</properties>
</component>
<hspacer id="41901">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="90" height="-1"/>
</grid>
</constraints>
</hspacer>
</children>
</grid>
<grid id="f099a" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="97622" class="javax.swing.JButton" binding="bt_sendMessage">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="14" style="1"/>
<text value="发送消息"/>
</properties>
</component>
<component id="61b7e" class="javax.swing.JButton" binding="bt_checkIn">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="14" style="1"/>
<text value="发布签到"/>
</properties>
</component>
<component id="dadfd" class="javax.swing.JButton" binding="bt_attendance">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="14" style="1"/>
<text value="考勤情况"/>
</properties>
</component>
<component id="8c182" class="javax.swing.JButton" binding="bt_select">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="14" style="1"/>
<text value="随机选人"/>
</properties>
</component>
</children>
</grid>
<grid id="71d67" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="fef1f" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="2d479" class="javax.swing.JTextField" binding="workNo">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
<font name="Microsoft YaHei" size="24"/>
</properties>
</component>
<component id="3ffec" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="62" height="17"/>
</grid>
</constraints>
<properties>
<font name="Microsoft YaHei" size="24" style="1"/>
<text value="工号:"/>
</properties>
</component>
</children>
</grid>
<grid id="be581" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="8409d" class="javax.swing.JButton" binding="changePasswordButton">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="14" style="1"/>
<horizontalTextPosition value="11"/>
<text value="修改密码"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,101 @@
package com.cfive.classroom.teacher;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
public class Main {
private static final Main main=new Main();
private static JFrame frame = new JFrame("课堂互动通");
private JPanel rootPanel;
private JButton bt_checkIn;
private JButton bt_attendance;
private JButton bt_select;
private JButton bt_sendMessage;
private JButton changePasswordButton;
private JTextField workNo;
private JTextField className;
public Main() {
bt_sendMessage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
SendMessage sendMessage=new SendMessage();
sendMessage.start();
}
});
bt_checkIn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
CheckIn checkIn=new CheckIn();
checkIn.start();
}
});
bt_attendance.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Attendance attendance=new Attendance();
attendance.start();
}
});
bt_select.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int person;
String count;
Object[] possibleValues = {"提问1个同学", "提问2个同学", "提问3个同学", "提问4个同学", "提问5个同学", "提问6个同学", "提问7个同学"};
Object selectedValue = JOptionPane.showInputDialog(null, "选择提问同学个数", "随机选人,持续工作中...",
JOptionPane.INFORMATION_MESSAGE, null, possibleValues, possibleValues[0]);
while (true) {
count = "";
String substring = selectedValue.toString().substring(2, 3);
int i = Integer.parseInt(substring);
String[] arr = new String[i];
for (int j = 0; j < i; ) {
//随机得到的数值
person = (int) (Math.random() * 10);
//遍历数组对
if (!Arrays.asList(arr).contains(String.valueOf(person))) {
arr[j] = String.valueOf(person);
j++;
}
}
String[] arr2 = {"小白 ", "小红 ", "小黑 ", "小绿 ", "小宗 ", "小橙 ", "小黄 ", "小青 ", "小蓝 ", "小紫 ", };
for (int s = 0; s < arr.length; s++) {
person = Integer.parseInt(arr[s]);
count += arr2[person];
}
JOptionPane.showMessageDialog(null, "恭喜以下同学,获得了本次回答问题的机会\n\t\n" + count);
break;
}
}
});
changePasswordButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ChangePassword changePassword=new ChangePassword();
changePassword.start();
}
});
}
public static void main(String[] args) {
frame.setContentPane(main.rootPanel);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(false);
}
public static void start(String workerNo,String className){
frame.setContentPane(main.rootPanel);
frame.setSize(600,400);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
main.workNo.setText(workerNo);
main.className.setText(className);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.MainWindow">
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</form>

View File

@@ -1,23 +0,0 @@
package com.cfive.classroom.teacher;
import com.cfive.classroom.library.net.Test;
import javax.swing.*;
public class MainWindow {
private JPanel rootPanel;
public static void main(String[] args) {
JFrame frame = new JFrame("MainWindow");
frame.setContentPane(new MainWindow().rootPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
Test.run();
com.cfive.classroom.library.database.Test.run();
System.out.println("This is a test");
}
}

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.SendMessage">
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="c04c0" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="5" bottom="0" right="5"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="aa5a2" class="javax.swing.JTextPane" binding="textPane1" default-binding="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="150" height="50"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<grid id="855b2" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<scrollpane id="ac4d">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="7754d" class="javax.swing.JTextArea" binding="textArea1" default-binding="true">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
<grid id="6683c" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="5" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e278e" class="javax.swing.JButton" binding="bt_send">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="发送"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,28 @@
package com.cfive.classroom.teacher;
import javax.swing.*;
public class SendMessage {
private static final SendMessage sendMessage=new SendMessage();
private static JFrame frame = new JFrame("SendMessage");
private JPanel rootPanel;
private JTextPane textPane1;
private JTextArea textArea1;
private JButton bt_send;
public static void main(String[] args) {
frame.setContentPane(sendMessage.rootPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(false);
}
public void start(){
frame.setContentPane(sendMessage.rootPanel);
frame.setBounds(600,400,600,400);
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

View File

@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.cfive.classroom.teacher.SignIn">
<grid id="27dc6" binding="rootJPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="50" left="50" bottom="50" right="50"/>
<constraints>
<xy x="20" y="20" width="500" height="433"/>
</constraints>
<properties>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="405f2" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="b509" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="48" style="1"/>
<text value="课堂互动通"/>
</properties>
</component>
</children>
</grid>
<grid id="26708" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="da3c5" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="20" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="8fe26" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="true"/>
<font name="Microsoft YaHei" size="18" style="0"/>
<text value="工号"/>
</properties>
</component>
<component id="64a15" class="javax.swing.JTextField" binding="workerNo">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<font size="18"/>
</properties>
</component>
</children>
</grid>
<grid id="e462a" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="20" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="3cd1e" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Microsoft YaHei" size="18" style="0"/>
<text value="密码"/>
</properties>
</component>
<component id="5357c" class="javax.swing.JPasswordField" binding="password">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<font size="18"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="7362b" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="df6d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="20" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="b343e" class="javax.swing.JButton" binding="login_Button">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<horizontalAlignment value="0"/>
<horizontalTextPosition value="11"/>
<text value="登录"/>
</properties>
</component>
</children>
</grid>
<grid id="aed71" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="528c" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,47 @@
package com.cfive.classroom.teacher;
import com.formdev.flatlaf.FlatDarculaLaf;
import com.formdev.flatlaf.FlatLightLaf;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class SignIn {
private static final SignIn sigIn = new SignIn();
private static final JFrame frame = new JFrame("教师端");;
private JPanel rootJPanel;
private JButton login_Button;
private JTextField workerNo;
private JPasswordField password;
public static void main(String[] args) {
FlatLightLaf.setup();
frame.setContentPane(sigIn.rootJPanel);
frame.setSize(600,400);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
sigIn.login_Button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(!sigIn.workerNo.getText().isEmpty()&&!sigIn.password.getText().isEmpty()){
ClassList classList = new ClassList();
String test=sigIn.workerNo.getText().toString();
classList.start(test);
frame.setVisible(false);
}else{
JOptionPane.showMessageDialog(null,"用户名和密码不能为空","提示!!",JOptionPane.ERROR_MESSAGE);
}
}
});
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}