java电子教室

  • u4_422127
    了解作者
  • 3.5MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-01 12:09
    上传日期
java版电子教室,使用java语言编写,具有教学广播,学生机监控,文件分发等功能,基于socket与多线程开发
JAVA.zip
内容介绍
package com.server.frame; import java.awt.BorderLayout; import java.awt.Color; import java.awt.EventQueue; import java.awt.Image; import java.awt.MenuItem; import java.awt.Point; import java.awt.PopupMenu; import java.awt.SystemTray; import java.awt.TrayIcon; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ScrollPaneConstants; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import com.server.action.RadioServer; import com.server.date.StaticDate; import com.server.tool.CommunicationTool; import com.server.tool.Message; import java.awt.FlowLayout; import javax.swing.JTextField; import javax.swing.JButton; import java.awt.Font; import java.net.InetAddress; import java.net.Socket; import javax.swing.JLabel; import javax.swing.JTextArea; import javax.swing.SwingConstants; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class MainFrame extends JFrame { private RadioServer radioserver = new RadioServer();// 声明广播线程 private JPanel contentPane; private JTextField textField; private JButton startRadiobtn; private JButton longHelpbtn; private JButton longDrownbtn; private JButton sendFilebtn; private JButton aboutbtn; private JButton exitRaidobtn; private JButton sendbtn; private static JTextArea messArea; private static JTable Logtable; public static JTextArea getMessArea() { return messArea; } public static JTable getLogtable() { return Logtable; } /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { UIManager .setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); MainFrame frame = new MainFrame(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public MainFrame() { new PopMenu(this); init(); } public void init() { // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 0, 900, 720); setResizable(false); this.setIconImage(this.getToolkit().getImage(getClass().getResource("/image/background.jpg"))); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setBackground(new Color(224, 223, 223)); setContentPane(contentPane); contentPane.setLayout(null); this.setLocationRelativeTo(null); JPanel featurepel = new JPanel(); featurepel.setBounds(610, 10, 280, 680); featurepel.setBackground(new Color(238, 239, 239)); contentPane.add(featurepel); featurepel.setLayout(null); JLabel lblNewLabel_3 = new JLabel(""); lblNewLabel_3.setIcon(new ImageIcon(MainFrame.class .getResource("/image/yuanjiao4.png"))); lblNewLabel_3.setBounds(6, 503, 269, 27); featurepel.add(lblNewLabel_3); JLabel label = new JLabel(""); label.setIcon(new ImageIcon(MainFrame.class .getResource("/image/yuanjiao3.png"))); label.setBounds(6, 325, 269, 27); featurepel.add(label); JLabel label_1 = new JLabel(""); label_1.setIcon(new ImageIcon(MainFrame.class .getResource("/image/yuanjiao2.png"))); label_1.setBounds(6, 178, 269, 27); featurepel.add(label_1); JLabel label_2 = new JLabel(""); label_2.setForeground(Color.BLACK); label_2.setIcon(new ImageIcon(MainFrame.class .getResource("/image/yuanjiao1.png"))); label_2.setBounds(6, 10, 269, 27); featurepel.add(label_2); startRadiobtn = new JButton(" \u6559\u5B66\u5E7F\u64AD"); startRadiobtn.setIcon(new ImageIcon(MainFrame.class .getResource("/image/radio.png"))); startRadiobtn.setHorizontalAlignment(SwingConstants.LEFT); startRadiobtn.setFont(new Font("黑体", Font.PLAIN, 20)); startRadiobtn.setBounds(29, 47, 199, 40); startRadiobtn.setOpaque(false); // startRadiobtn.setContentAreaFilled(false); featurepel.add(startRadiobtn); exitRaidobtn = new JButton(" \u505C\u6B62\u5E7F\u64AD"); exitRaidobtn.setIcon(new ImageIcon(MainFrame.class .getResource("/image/exitradio.png"))); exitRaidobtn.setOpaque(false); exitRaidobtn.setHorizontalAlignment(SwingConstants.LEFT); exitRaidobtn.setFont(new Font("黑体", Font.PLAIN, 20)); // exitRaidobtn.setContentAreaFilled(false); exitRaidobtn.setEnabled(false); exitRaidobtn.setBounds(29, 101, 199, 40); featurepel.add(exitRaidobtn); longHelpbtn = new JButton(" \u8FDC\u7A0B\u534F\u52A9"); longHelpbtn.setIcon(new ImageIcon(MainFrame.class .getResource("/image/longhelp.png"))); longHelpbtn.setOpaque(false); longHelpbtn.setHorizontalAlignment(SwingConstants.LEFT); longHelpbtn.setFont(new Font("黑体", Font.PLAIN, 20)); // longHelpbtn.setContentAreaFilled(false); longHelpbtn.setBounds(29, 214, 199, 40); featurepel.add(longHelpbtn); longDrownbtn = new JButton(" \u8FDC\u7A0B\u5173\u673A"); longDrownbtn.setHorizontalAlignment(SwingConstants.LEFT); longDrownbtn.setIcon(new ImageIcon(MainFrame.class .getResource("/image/longdown.png"))); longDrownbtn.setOpaque(false); longDrownbtn.setFont(new Font("黑体", Font.PLAIN, 20)); // longDrownbtn.setContentAreaFilled(false); longDrownbtn.setBounds(29, 275, 199, 40); featurepel.add(longDrownbtn); sendFilebtn = new JButton(" \u53D1\u9001\u6587\u4EF6"); sendFilebtn.setIcon(new ImageIcon(MainFrame.class .getResource("/image/sendfile.png"))); sendFilebtn.setOpaque(false); sendFilebtn.setHorizontalAlignment(SwingConstants.LEFT); sendFilebtn.setFont(new Font("黑体", Font.PLAIN, 20)); // sendFilebtn.setContentAreaFilled(false); sendFilebtn.setBounds(29, 388, 199, 40); featurepel.add(sendFilebtn); aboutbtn = new JButton(" \u5173\u4E8E"); aboutbtn.setIcon(new ImageIcon(MainFrame.class .getResource("/image/about.png"))); aboutbtn.setOpaque(false); aboutbtn.setHorizontalAlignment(SwingConstants.LEFT); aboutbtn.setFont(new Font("黑体", Font.PLAIN, 20)); // aboutbtn.setContentAreaFilled(false); aboutbtn.setBounds(29, 550, 199, 40); featurepel.add(aboutbtn); JLabel lblNewLabel_4 = new JLabel("\u672C\u673AIP\uFF1A"); String hostip=CommunicationTool.getHostIp(); lblNewLabel_4.setText( lblNewLabel_4.getText()+hostip); lblNewLabel_4.setFont(new Font("微软雅黑", Font.BOLD, 18)); lblNewLabel_4.setBounds(6, 643, 269, 27); featurepel.add(lblNewLabel_4); JPanel sendpel = new JPanel(); sendpel.setBounds(10, 540, 590, 150); sendpel.setBackground(new Color(157, 158, 157)); contentPane.add(sendpel); sendpel.setLayout(null); JPanel messpel = new JPanel(); messpel.setBounds(10, 10, 320, 133); messpel.setBackground(new Color(114, 113, 113)); sendpel.add(messpel); messpel.setLayout(null); textField = new JTextField(); textField.setBounds(10, 90, 210, 34); messpel.add(textField); textField.setColumns(10); sendbtn = new JButton("\u53D1\u9001"); sendbtn.setFont(new Font("黑体", Font.PLAIN, 18)); sendbtn.setBounds(237, 90, 73, 32); sendbtn.setBackground(Color.WHITE); messpel.add(sendbtn); JLabel lblNewLabel = new JLabel("\u6D88\u606F:"); lblNewLabel.setFont(new Font("黑体", Font.BOLD, 14)); lblNewLabel.setForeground(new Color(250, 235, 215)); lblNewLabel.setBounds(3, 3, 307, 15); messpel.add(lblNewLabel); JScrollPane scrollmess=new JScrollPane(); messArea = new JTextArea(); messArea.setEditable(false); scrollmess.setBounds(13, 23, 297, 57); messArea.setBackgroun
评论
    相关推荐
    • Java
      Java
    • java
      Java
    • Java
      Java
    • Java
      Java项目
    • Java
      Java 对于Java练习
    • java
      Java 此回购包括我学习Java的旅程。
    • java
      Java Java基础
    • Java
      Java
    • Java
      Java 我创建的Java项目
    • Java
      Java 2021/02/19 .java Main.java 学生.java Bmi.java 。班级 Bmi类 主类 MyBmi.class 学生班 学生样本类 2021/02/20 .java DeleteFile.java WriteFile.java MyDataPrint.java 。班级 DeleteFile.class ...