counter.java

来自「通用学校竞赛计分计时系统」· Java 代码 · 共 639 行 · 第 1/2 页

JAVA
639
字号
/*
 * Counter.java
 *
 * Created on __DATE__, __TIME__
 */

package nror.syq.cc;

import java.util.Calendar;

/**
 *
 * @author  __USER__
 */
public class Counter extends javax.swing.JFrame
{

	/** Creates new form Counter */
	public Counter()
	{
		initComponents();
		this.setResizable(false);
		this.setLocationRelativeTo(null);
		
	}

	
	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents()
	{
		
		jLabel1 = new javax.swing.JLabel();
		g1 = new javax.swing.JLabel();
		g2 = new javax.swing.JLabel();
		g3 = new javax.swing.JLabel();
		g4 = new javax.swing.JLabel();
		g5 = new javax.swing.JLabel();
		s1 = new javax.swing.JLabel();
		s2 = new javax.swing.JLabel();
		s3 = new javax.swing.JLabel();
		s4 = new javax.swing.JLabel();
		s5 = new javax.swing.JLabel();
		jButton1 = new javax.swing.JButton();
		jComboBox1 = new javax.swing.JComboBox();
		jComboBox2 = new javax.swing.JComboBox();
		jLabel12 = new javax.swing.JLabel();
		jButton2 = new javax.swing.JButton();
		jComboBox3 = new javax.swing.JComboBox();
		lblmin = new javax.swing.JLabel();
		jLabel3 = new javax.swing.JLabel();
		lblsec = new javax.swing.JLabel();
		jLabel5 = new javax.swing.JLabel();
		jButton3 = new javax.swing.JButton();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
		setTitle("计时计分系统");

		jLabel1.setFont(new java.awt.Font("微软雅黑", 0, 36));
		jLabel1
				.setText("计算机学院C语言竞赛计分系统");

		g1.setFont(new java.awt.Font("微软雅黑", 0, 14));
		g1.setText("\u7b2c\u4e00\u7ec4");

		g2.setFont(new java.awt.Font("微软雅黑", 0, 14));
		g2.setText("\u7b2c\u4e8c\u7ec4");

		g3.setFont(new java.awt.Font("微软雅黑", 0, 14));
		g3.setText("\u7b2c\u4e09\u7ec4");

		g4.setFont(new java.awt.Font("微软雅黑", 0, 14));
		g4.setText("\u7b2c\u56db\u7ec4");

		g5.setFont(new java.awt.Font("微软雅黑", 0, 14));
		g5.setText("\u7b2c\u4e94\u7ec4");

		s1.setFont(new java.awt.Font("宋体", 0, 36));
		s1.setText("100");

		s2.setFont(new java.awt.Font("宋体", 0, 36));
		s2.setText("100");

		s3.setFont(new java.awt.Font("宋体", 0, 36));
		s3.setText("100");

		s4.setFont(new java.awt.Font("宋体", 0, 36));
		s4.setText("100");

		s5.setFont(new java.awt.Font("宋体", 0, 36));
		s5.setText("100");

		jButton1.setText("\u52a0\u5206");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt)
			{
				jButton1ActionPerformed(evt);
			}
		});

		jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"第一组", "第二组", "第三组", "第四组","第五组" }));

		jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"5", "10", "15", "20" }));

		jLabel12.setFont(new java.awt.Font("微软雅黑", 0, 36));
		jLabel12.setText("\u5012\u8ba1\u65f6\uff1a");

		jButton2.setText("\u5012\u8ba1\u65f6");
		jButton2.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt)
			{
				jButton2ActionPerformed(evt);
			}
		});

		jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"1分钟", "3分钟", "5分钟", "10分钟" }));

		lblmin.setFont(new java.awt.Font("宋体", 0, 36));
		lblmin.setText("**");

		jLabel3.setFont(new java.awt.Font("微软雅黑", 0, 24));
		jLabel3.setText("\u5206");

		lblsec.setFont(new java.awt.Font("宋体", 0, 36));
		lblsec.setText("**");

		jLabel5.setFont(new java.awt.Font("微软雅黑", 0, 24));
		jLabel5.setText("\u79d2");

		jButton3.setText("\u51cf\u5206");
		jButton3.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt)
			{
				jButton3ActionPerformed(evt);
			}
		});

		org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout
				.setHorizontalGroup(layout
						.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								layout
										.createSequentialGroup()
										.add(
												layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(
																layout.createSequentialGroup().add(111, 111,
																		111).add(jLabel12))
														.add(
																layout
																		.createSequentialGroup()
																		.add(30, 30, 30)
																		.add(
																				layout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.TRAILING)
																						.add(g1).add(s1))
																		.add(84, 84, 84)
																		.add(
																				layout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.TRAILING)
																						.add(g2).add(s2))
																		.add(
																				layout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.LEADING)
																						.add(
																								layout
																										.createSequentialGroup()
																										.add(56, 56, 56)
																										.add(
																												lblmin,
																												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																												70,
																												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												org.jdesktop.layout.LayoutStyle.RELATED)
																										.add(jLabel3)
																										.add(27, 27, 27)
																										.add(
																												lblsec,
																												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																												Short.MAX_VALUE)
																										.addPreferredGap(
																												org.jdesktop.layout.LayoutStyle.RELATED))
																						.add(
																								layout
																										.createSequentialGroup()
																										.add(89, 89, 89)
																										.add(
																												layout
																														.createParallelGroup(
																																org.jdesktop.layout.GroupLayout.LEADING,
																																false)
																														.add(
																																layout
																																		.createSequentialGroup()
																																		.add(12,
																																				12, 12)
																																		.add(g3))
																														.add(s3))))))
										.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
										.add(
												layout.createParallelGroup(
														org.jdesktop.layout.GroupLayout.TRAILING).add(g4)
														.add(s4).add(jLabel5)).add(94, 94, 94).add(
												layout.createParallelGroup(
														org.jdesktop.layout.GroupLayout.TRAILING).add(g5)
														.add(s5)).add(55, 55, 55))
						.add(
								layout.createSequentialGroup().add(119, 119, 119).add(jLabel1)
										.addContainerGap(131, Short.MAX_VALUE))
						.add(
								org.jdesktop.layout.GroupLayout.TRAILING,
								layout
										.createSequentialGroup()
										.addContainerGap(195, Short.MAX_VALUE)
										.add(jComboBox1,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
										.add(
												layout.createParallelGroup(
														org.jdesktop.layout.GroupLayout.TRAILING).add(
														jComboBox3,
														org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
														org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
														org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
														.add(org.jdesktop.layout.GroupLayout.LEADING,
																jComboBox2,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
										.add(30, 30, 30).add(
												layout.createParallelGroup(
														org.jdesktop.layout.GroupLayout.TRAILING, false)
														.add(jButton1,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																Short.MAX_VALUE).add(jButton2))
										.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
										.add(jButton3,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 74,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(
												190, 190, 190)));
		layout
				.setVerticalGroup(layout
						.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								layout
										.createSequentialGroup()
										.addContainerGap()
										.add(
												layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.TRAILING)
														.add(
																layout.createSequentialGroup().add(g5).add(40,
																		40, 40).add(s5))
														.add(
																layout
																		.createSequentialGroup()
																		.add(jLabel1)
																		.add(37, 37, 37)
																		.add(
																				layout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.LEADING)
																						.add(
																								layout
																										.createParallelGroup(
																												org.jdesktop.layout.GroupLayout.TRAILING)
																										.add(
																												layout
																														.createSequentialGroup()
																														.add(g1).add(40,
																																40, 40).add(s1))
																										.add(
																												layout
																														.createParallelGroup(
																																org.jdesktop.layout.GroupLayout.LEADING)
																														.add(g2)
																														.add(
																																layout
																																		.createSequentialGroup()
																																		.add(59,
																																				59, 59)
																																		.add(s2))))
																						.add(
																								layout.createSequentialGroup()
																										.add(g3).add(40, 40, 40)
																										.add(s3)).add(
																								layout.createSequentialGroup()
																										.add(g4).add(40, 40, 40)
																										.add(s4)))))
										.add(50, 50, 50)
										.add(
												layout.createParallelGroup(
														org.jdesktop.layout.GroupLayout.BASELINE).add(
														jLabel12).add(lblmin,
														org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 58,
														org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
														.add(lblsec,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?