mainframe.java
字号:
} }); R.addTab("一班", R1); Rx.setBorder(javax.swing.BorderFactory.createEtchedBorder()); org.jdesktop.layout.GroupLayout showLayout = new org.jdesktop.layout.GroupLayout(show); show.setLayout(showLayout); showLayout.setHorizontalGroup( showLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 354, Short.MAX_VALUE) ); showLayout.setVerticalGroup( showLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 280, Short.MAX_VALUE) ); jLabel12.setText("最高分"); jLabel13.setText("最低分"); org.jdesktop.layout.GroupLayout RxLayout = new org.jdesktop.layout.GroupLayout(Rx); Rx.setLayout(RxLayout); RxLayout.setHorizontalGroup( RxLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, RxLayout.createSequentialGroup() .add(RxLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(RxLayout.createSequentialGroup() .addContainerGap() .add(Low, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 67, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(RxLayout.createSequentialGroup() .addContainerGap() .add(High, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(RxLayout.createSequentialGroup() .add(25, 25, 25) .add(jLabel12)) .add(RxLayout.createSequentialGroup() .add(24, 24, 24) .add(jLabel13))) .add(26, 26, 26) .add(show, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); RxLayout.setVerticalGroup( RxLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(RxLayout.createSequentialGroup() .addContainerGap(55, Short.MAX_VALUE) .add(RxLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, RxLayout.createSequentialGroup() .add(show, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .add(org.jdesktop.layout.GroupLayout.TRAILING, RxLayout.createSequentialGroup() .add(jLabel12) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(High, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(26, 26, 26) .add(jLabel13) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(Low, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(21, 21, 21)))) ); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jToolBar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 702, Short.MAX_VALUE) .add(layout.createSequentialGroup() .addContainerGap() .add(L, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 205, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(Rx, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(R, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 471, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jToolBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(R, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(Rx, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(L, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponentsprivate void jt2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jt2ActionPerformed// TODO add your handling code here:}//GEN-LAST:event_jt2ActionPerformedprivate void jt3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jt3ActionPerformed// TODO add your handling code here:}//GEN-LAST:event_jt3ActionPerformedprivate void RStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_RStateChanged}//GEN-LAST:event_RStateChangedprivate void R2FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_R2FocusGained}//GEN-LAST:event_R2FocusGainedprivate void R2ComponentAdded(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_R2ComponentAdded// TODO add your handling code here:}//GEN-LAST:event_R2ComponentAddedprivate void R2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_R2MouseClicked// TODO add your handling code here: }//GEN-LAST:event_R2MouseClickedprivate void R2FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_R2FocusLost// TODO add your handling code here:}//GEN-LAST:event_R2FocusLostprivate void TimeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TimeMouseClicked// TODO add your handling code here: h.setVisible(true);}//GEN-LAST:event_TimeMouseClickedprivate void R2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_R2MousePressed// TODO add your handling code here:}//GEN-LAST:event_R2MousePressedprivate void R3MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_R3MousePressed// TODO add your handling code here:}//GEN-LAST:event_R3MousePressedprivate void R1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_R1FocusGained// TODO add your handling code here:}//GEN-LAST:event_R1FocusGainedprivate void R1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_R1MouseEntered// TODO add your handling code here:}//GEN-LAST:event_R1MouseEnteredprivate void R3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_R3MouseEntered// TODO add your handling code here:}//GEN-LAST:event_R3MouseEnteredprivate void R2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_R2MouseEntered// TODO add your handling code here:}//GEN-LAST:event_R2MouseEnteredprivate void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed if (jComboBox1.getSelectedIndex() == 0) { count0.setText("(" + rate1.r2 + "人)"); count1.setText("(" + rate1.r0 + "人)"); count2.setText("(" + rate1.r3 + "人)"); count3.setText("(" + rate1.r1 + "人)"); count4.setText("(" + rate1.r4 + "人)"); ww.set(rate1.r0, rate1.r1, rate1.r2, rate1.r3, rate1.r4); ww.setSize(200, 200); show.removeAll(); show.add(ww); High.setText("" + fh1); Low.setText("" + fl1); show.repaint(); } if (jComboBox1.getSelectedIndex() == 1) { count0.setText("(" + rate2.r2 + "人)"); count1.setText("(" + rate2.r0 + "人)"); count2.setText("(" + rate2.r3 + "人)"); count3.setText("(" + rate2.r1 + "人)"); count4.setText("(" + rate2.r4 + "人)"); ww.set(rate2.r0, rate2.r1, rate2.r2, rate2.r3, rate2.r4); ww.setSize(200, 200); show.removeAll(); show.add(ww); High.setText("" + fh2); Low.setText("" + fl2); show.repaint(); } if (jComboBox1.getSelectedIndex() == 2) { count0.setText("(" + rate3.r2 + "人)"); count1.setText("(" + rate3.r0 + "人)"); count2.setText("(" + rate3.r3 + "人)"); count3.setText("(" + rate3.r1 + "人)"); count4.setText("(" + rate3.r4 + "人)"); ww.set(rate3.r0, rate3.r1, rate3.r2, rate3.r3, rate3.r4); ww.setSize(200, 200); show.removeAll(); show.add(ww); High.setText("" + fh3); Low.setText("" + fl3); show.repaint(); } }//GEN-LAST:event_jButton6ActionPerformedprivate void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed// TODO add your handling code here: if (jComboBox1.getSelectedIndex() == 1) { count0.setText("(" + rate2.r2 + "人)"); count1.setText("(" + rate2.r0 + "人)"); count2.setText("(" + rate2.r3 + "人)"); count3.setText("(" + rate2.r1 + "人)"); count4.setText("(" + rate2.r4 + "人)"); zz.set(rate1.r0, rate1.r1, rate1.r2, rate1.r3, rate1.r4); zz.setSize(300, 300); show.removeAll(); show.add(zz); show.repaint(); }if (jComboBox1.getSelectedIndex() == 0) { count0.setText("(" + rate1.r2 + "人)"); count1.setText("(" + rate1.r0 + "人)"); count2.setText("(" + rate1.r3 + "人)"); count3.setText("(" + rate1.r1 + "人)"); count4.setText("(" + rate1.r4 + "人)"); zz.set(rate2.r0, rate2.r1, rate2.r2, rate2.r3, rate2.r4); zz.setSize(300, 300); show.removeAll(); show.add(zz); show.repaint(); }if (jComboBox1.getSelectedIndex() == 2) { zz.set(rate3.r0, rate1.r3, rate3.r2, rate3.r3, rate3.r4); zz.setSize(300, 300); show.removeAll(); show.add(zz); show.repaint(); }}//GEN-LAST:event_jButton7ActionPerformedprivate void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed// TODO add your handling code here:}//GEN-LAST:event_jComboBox1ActionPerformed public String getCurrentTime() { long tmil = System.currentTimeMillis(); long tse = tmil / 1000; int cse = (int) (tse % 60); long tminutes = tse / 60; int cmi = (int) (tminutes % 60); long totalHours = tminutes / 60; int currentHour = (int) (totalHours % 24) + 8; String output = currentHour + ":" + cmi + ":" + cse; return output; }public void actionPerformed(ActionEvent e) { Time.setText(getCurrentTime()); }/** * @param args the command line arguments */public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { MainFrame f = new MainFrame(); f.setVisible(true); }}); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField High; private static javax.swing.JPanel L; private javax.swing.JTextField Low; public static transient javax.swing.JTabbedPane R; public javax.swing.JPanel R1; private javax.swing.JPanel R2; private javax.swing.JPanel R3; private javax.swing.JPanel Rx; private javax.swing.JTextField Time; public static javax.swing.JLabel count0; private javax.swing.JLabel count1; private javax.swing.JLabel count2; private javax.swing.JLabel count3; private javax.swing.JLabel count4; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JSeparator jSeparator1; private javax.swing.JSeparator jSeparator2; private javax.swing.JSeparator jSeparator3; private javax.swing.JTextField jTextField1; private javax.swing.JToolBar jToolBar; public static javax.swing.JTextField jt1; public static javax.swing.JTextField jt2; public static javax.swing.JTextField jt3; public static javax.swing.JTextField jt4; public static javax.swing.JTextField jt5; public static javax.swing.JTextField jt6; public static javax.swing.JTextField jt7; public static javax.swing.JTextField jt8; private javax.swing.JPanel show; // End of variables declaration//GEN-END:variables}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -