⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainframe.java

📁 本光盘包含了本书各章中出现的所有程序的源代码。 1. 如果是Java程序
💻 JAVA
字号:
/*
 * mainFrame.java
 *
 * Created on __DATE__, __TIME__
 */

package charFrame;

import javax.swing.UIManager;

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

	/** Creates new form mainFrame */

	private loginFrame logF;

	/** Creates new form regFrame */
	public mainFrame(loginFrame logf) {
		this.logF = logf;
		try {
			//设置显示外观为本地系统外观。注意此句需放在初始化所有控件之前。
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			e.printStackTrace();
		}

		initComponents();
	}
	/** 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() {
		jSplitPane1 = new javax.swing.JSplitPane();
		jPanel1 = new javax.swing.JPanel();
		jScrollPane1 = new javax.swing.JScrollPane();
		jOutput = new javax.swing.JTextArea();
		jScrollPane2 = new javax.swing.JScrollPane();
		jInput = new javax.swing.JTextArea();
		jExit = new javax.swing.JButton();
		jButton2 = new javax.swing.JButton();
		jSeparator1 = new javax.swing.JSeparator();
		jScrollPane3 = new javax.swing.JScrollPane();
		jList = new javax.swing.JTextArea();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
		setBackground(new java.awt.Color(51, 102, 255));
		jSplitPane1.setBackground(new java.awt.Color(102, 255, 102));
		jSplitPane1.setDividerLocation(359);
		jSplitPane1.setDividerSize(7);
		jOutput.setColumns(20);
		jOutput.setRows(5);
		jScrollPane1.setViewportView(jOutput);

		jInput.setColumns(20);
		jInput.setRows(5);
		jScrollPane2.setViewportView(jInput);

		jExit.setText("\u5173\u95ed");
		jExit.setActionCommand("exit");

		jButton2.setText("\u53d1\u9001");
		jButton2.setActionCommand("send");

		org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(
				jPanel1);
		jPanel1.setLayout(jPanel1Layout);
		jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(
				org.jdesktop.layout.GroupLayout.LEADING).add(
				jPanel1Layout.createSequentialGroup().addContainerGap().add(
						jPanel1Layout.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING).add(
								jScrollPane1,
								org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
								338, Short.MAX_VALUE).add(
								org.jdesktop.layout.GroupLayout.TRAILING,
								jPanel1Layout.createSequentialGroup()
										.add(jExit).add(28, 28, 28).add(
												jButton2)).add(jScrollPane2,
								org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
								338, Short.MAX_VALUE).add(jSeparator1,
								org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
								338, Short.MAX_VALUE)).addContainerGap()));
		jPanel1Layout
				.setVerticalGroup(jPanel1Layout
						.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								jPanel1Layout
										.createSequentialGroup()
										.addContainerGap()
										.add(
												jScrollPane1,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
												250,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
										.add(17, 17, 17)
										.add(
												jSeparator1,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
												10,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												org.jdesktop.layout.LayoutStyle.RELATED)
										.add(
												jScrollPane2,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
												88,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
										.add(27, 27, 27)
										.add(
												jPanel1Layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.BASELINE)
														.add(jButton2).add(
																jExit))
										.addContainerGap(18, Short.MAX_VALUE)));
		jSplitPane1.setLeftComponent(jPanel1);

		jList.setColumns(20);
		jList.setRows(5);
		jScrollPane3.setViewportView(jList);

		jSplitPane1.setRightComponent(jScrollPane3);

		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().addContainerGap(
						org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
						Short.MAX_VALUE).add(jSplitPane1,
						org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 560,
						org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
		layout.setVerticalGroup(layout.createParallelGroup(
				org.jdesktop.layout.GroupLayout.LEADING).add(
				layout.createSequentialGroup().addContainerGap(
						org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
						Short.MAX_VALUE).add(jSplitPane1,
						org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 451,
						org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
		this.setVisible(true);
		this.setResizable(false);
		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
		pack();
	}// </editor-fold>//GEN-END:initComponents

	/**
	 * @param args the command line arguments
	 *
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new mainFrame().setVisible(true);
			}
		});
	}
/***/
	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton jButton2;
	private javax.swing.JButton jExit;
	private javax.swing.JTextArea jInput;
	private javax.swing.JTextArea jList;
	private javax.swing.JTextArea jOutput;
	private javax.swing.JPanel jPanel1;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JScrollPane jScrollPane2;
	private javax.swing.JScrollPane jScrollPane3;
	private javax.swing.JSeparator jSeparator1;
	private javax.swing.JSplitPane jSplitPane1;
	// End of variables declaration//GEN-END:variables

}

⌨️ 快捷键说明

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