📄 mainframe.java
字号:
/* * MainFrame.java * * Created on 2008骞?2鏈?鏃? 涓嬪崍10:35 */package test02;import javax.swing.*;import java.awt.event.*;import java.sql.*;public class MainFrame extends javax.swing.JFrame implements ActionListener { PieChart1 ww = new PieChart1(); zhiFangTu zz = new zhiFangTu(); public static JTool m1, m2, m3; Timer timer = new Timer(1000, this); public static addStudent h = new addStudent(); public static SearchStudent s = new SearchStudent(); ratecount rate1 = new ratecount(); ratecount rate2 = new ratecount(); ratecount rate3 = new ratecount(); ratecount rate4 = new ratecount(); ratecount rate5 = new ratecount(); ratecount rate6 = new ratecount(); int fh1 = 0; int fh2 = 0; int fh3 = 0; int fl1 = 100; int fl2 = 100; int fl3 = 100; int sh1 = 0; int sh2 = 0; int sh3 = 0; int sl1 = 100; int sl2 = 100; int sl3 = 100; public MainFrame() { int s3 = 0; int e1 = 0; int e2 = 0; int e3 = 0; int r0 = 0; int r1 = 0; int r2 = 0; int r3 = 0; int r4 = 0; int ra = 0; int rb = 0; int rc = 0; int rd = 0; int re = 0; int b1 = 0; int b2 = 0; int b3 = 0; int b4 = 0; int b5 = 0; int y20 = 0; int y21 = 0; int y22 = 0; int y23 = 0; int y24 = 0; int y25 = 0; int s20 = 0; int s21 = 0; int s22 = 0; int s23 = 0; int s24 = 0; int e20 = 0; int e21 = 0; int e22 = 0; int e23 = 0; int e24 = 0; DBM db = new DBM(); String sql = "select * from course;"; ResultSet rs0 = db.getResult(sql); rs0 = db.getResult(sql); try { while (rs0.next()) { if (rs0.getString(2).equals("1")) { int a0 = Integer.parseInt(rs0.getString(3)); int a1 = Integer.parseInt(rs0.getString(4)); int a2 = Integer.parseInt(rs0.getString(5)); if (fh1 < a0) { fh1 = a0; } if (fh2 < a1) { fh2 = a1; } if (fh3 < a2) { fh3 = a2; } if (fl1 > a0) { fl1 = a0; } if (fl2 > a1) { fl2 = a1; } if (fl3 > a2) { fl3 = a2; } if (a0 < 60) { r0++; } if (60 <= a0 && a0 <= 69) { r1++; } if (70 <= a0 && a0 <= 79) { r2++; } if (80 <= a0 && a0 <= 89) { r3++; } if (90 <= a0 && a0 <= 100) { r4++; } if (a1 < 60) { ra++; } if (60 <= a1 && a1 <= 69) { rb++; } if (70 <= a1 && a1 <= 79) { rc++; } if (80 <= a1 && a1 <= 89) { rd++; } if (90 <= a1 && a1 <= 100) { re++; } if (a2 < 60) { b1++; } if (60 <= a2 && a2 <= 69) { b2++; } if (70 <= a2 && a2 <= 79) { b3++; } if (80 <= a2 && a2 <= 89) { b4++; } if (90 <= a2 && a2 <= 100) { b5++; } } } db.close(); } catch (SQLException exc) { exc.printStackTrace(); System.exit(1); } rate1.set(r0, r1, r2, r3, r4); rate2.set(ra, rb, rc, rd, re); rate3.set(b1, b2, b3, b4, b5); rate4.set(y20, y21, y22, y23, y24); rate5.set(s20, s21, s22, s23, s24); rate6.set(e20, e21, e22, e23, e24); timer.start(); initComponents(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String strurl = "jdbc:odbc:student";//鍒涘缓鎸囧畾鏁版嵁搴撶殑URL Connection con = null; con = DriverManager.getConnection(strurl); Statement sta = con.createStatement(); ResultSet rs = sta.executeQuery("select * from student;"); while (rs.next()) { { int num = Integer.parseInt(rs.getString(2)); String cla = rs.getString(3); String name = rs.getString(4); int id = Integer.parseInt(rs.getString(5)); if (cla.equals("1")) { student bt1 = new student("image/m01.gif", name, "瀛﹀彿锛?" + num, cla, id, true); R1.add(bt1); } if (cla.equals("2")) { student bt1 = new student("image/m01.gif", name, "瀛﹀彿锛?" + num, cla, id, true); R2.add(bt1); } if (cla.equals("3")) { student bt1 = new student("image/m01.gif", name, "瀛﹀彿锛?" + num, cla, id, true); R3.add(bt1); } } } } catch (Exception e) { e.printStackTrace(); } m1 = new JTool("image/m01.gif", " 瀛︾敓绠$悊 ", "澧炲姞浠ュ強鏌ョ湅瀛︾敓鎴愮哗", true); m2 = new JTool("image/m02.gif", " 鐝
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -