📄 coachsmaint.java
字号:
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*/package com.bromsoft.soccer;import java.awt.Component;import java.awt.Container;import java.sql.SQLException;import javax.swing.JFrame;import quick.dbtable.DBTable;import javax.swing.JOptionPane;import com.bromsoft.util.*;import javax.sql.*;import java.sql.*;import java.util.*;import java.io.*;import java.awt.event.*;import javax.swing.*;import java.awt.*;import java.awt.print.*;/** * Class declaration * * * @author * @version %I%, %G% */public class CoachsMaint extends JFrame implements KeyListener{ JSplash jspl; DBTable dbt1; String keyArray [] = {"id"}; String tableName = "coachs"; public CoachsMaint() { super(); initalize(); } public static void main(String args[]) { CoachsMaint me = new CoachsMaint(); me.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing( java.awt.event.WindowEvent e) { System.exit(0); }; }); } public void initalize() { try { jspl = new JSplash("bss.jpg" , "Coach Maintenance Program", 30000); } catch (Exception e) { e.printStackTrace(); } setTitle("Coachs Maintenance"); dbt1 = new DBTable(); getContentPane().add(dbt1); this.addKeyListener(this); try { dbt1.setDatabaseDriver(ConnectIO.getJdbcDriver()); dbt1.setJdbcUrl(ConnectIO.getJdbcURL()); dbt1.createControlPanel(); dbt1.connectDatabase(); DBTableBld.updateDBMethods("select * from Coachs order by Lastname, Firstname", dbt1, tableName, keyArray, true); pack(); CenterPane.center(this, 1000, 550); jspl.endJSplash(); setVisible(true); } catch (SQLException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } public void keyPressed(KeyEvent e) { } public void keyReleased(KeyEvent e) { try { if (e.getKeyCode() == e.VK_F5) { dbt1.refresh(); System.out.println("Refresh key pressed..."); } if (e.getKeyCode() == e.VK_F1 && e.isShiftDown()) { DBTableBld.updateDBMethods("select * from Coachs order by Lastname, Firstname", dbt1, tableName, keyArray, true); JOptionPane.showMessageDialog(null, "Reordered by Lastname, firstname"); } if (e.getKeyCode() == e.VK_F2 && e.isShiftDown()) { DBTableBld.updateDBMethods("Select * from coachs order by LastDivisionCoached, LastName, FirstName", dbt1, tableName, keyArray, true); JOptionPane.showMessageDialog( null, "Reordered by Last Division Coached, Lastname, firstname"); } if (e.getKeyCode() == e.VK_F3 && e.isShiftDown()) { DBTableBld.updateDBMethods("Select * from coachs order by ID", dbt1, tableName, keyArray, true); JOptionPane.showMessageDialog(null, "Reordered by ID Number"); } if (e.getKeyCode() == e.VK_F10) { new ExecSQLCommand(dbt1.getConnection()); } if (e.getKeyCode() == e.VK_F12) { int resp = JOptionPane.showConfirmDialog(null, "Exit Program?"); if (resp == 0) { System.exit(0); } } } catch (Exception e11) { DisplayBox db = new DisplayBox("Print Exception", "Exception:", e11, true); } } public void keyTyped(KeyEvent e) { } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -