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

📄 changegroupname.java

📁 桌面管理 可以将桌面的快捷方式集中管理
💻 JAVA
字号:
/*
 * gangeGroupName.java
 *
 * Created on __DATE__, __TIME__
 */

package com.deskManager.view;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.ArrayList;

import javax.swing.JFrame;

import com.deskManager.File.Data;
import com.deskManager.File.DataOperationObject;

/**
 * 
 * @author __USER__
 */
public class ChangeGroupName extends javax.swing.JDialog {
	/**
	 * 
	 */
	private static final long serialVersionUID = 710633457286645026L;
	ArrayList<Data> d;
	String[] group;
	JFrame temp;

	/** Creates new form gangeGroupName */
	public ChangeGroupName(JFrame parent, ArrayList<Data> temp) {
		super(parent, true);
		d = temp;
		this.temp = parent;
		group = new DataOperationObject().groups();
		initComponents();
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		this.setLocation((screenSize.width - this.getSize().width) / 2,
				(screenSize.height - this.getSize().height) / 2);
	}

	/**
	 * 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() {

		ok = new javax.swing.JButton();
		cannel = new javax.swing.JButton();
		groups = new javax.swing.JComboBox();
		jLabel1 = new javax.swing.JLabel();

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

		ok.setText("\u786e\u5b9a");
		ok.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				okActionPerformed(evt);
			}
		});

		cannel.setText("\u53d6\u6d88");
		cannel.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cannelActionPerformed(evt);
			}
		});

		groups.setEditable(true);
		if (!d.get(0).group.equals("")) {
			groups.setSelectedItem(d.get(0).group);
		}
		groups.setModel(new javax.swing.DefaultComboBoxModel(group));

		jLabel1.setText("\u8f6f\u4ef6\u7c7b\u578b");

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout
				.setHorizontalGroup(layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								layout
										.createSequentialGroup()
										.addGroup(
												layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																layout
																		.createSequentialGroup()
																		.addGap(
																				61,
																				61,
																				61)
																		.addComponent(
																				ok)
																		.addGap(
																				26,
																				26,
																				26)
																		.addComponent(
																				cannel))
														.addGroup(
																layout
																		.createSequentialGroup()
																		.addGap(
																				53,
																				53,
																				53)
																		.addComponent(
																				jLabel1)
																		.addGap(
																				18,
																				18,
																				18)
																		.addComponent(
																				groups,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				102,
																				javax.swing.GroupLayout.PREFERRED_SIZE)))
										.addContainerGap(53, Short.MAX_VALUE)));
		layout
				.setVerticalGroup(layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								layout
										.createSequentialGroup()
										.addGap(22, 22, 22)
										.addGroup(
												layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(jLabel1)
														.addComponent(
																groups,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.PREFERRED_SIZE))
										.addGap(18, 18, 18)
										.addGroup(
												layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.BASELINE)
														.addComponent(ok)
														.addComponent(cannel))
										.addContainerGap(27, Short.MAX_VALUE)));

		pack();
	}// </editor-fold>

	// GEN-END:initComponents

	private void cannelActionPerformed(java.awt.event.ActionEvent evt) {
		this.dispose();
	}

	private void okActionPerformed(java.awt.event.ActionEvent evt) {
		if (groups.getSelectedItem() != null) {
			new DataOperationObject().changeGroup(d, (String) groups
					.getSelectedItem());
			new DataOperationObject().taxis();
			MainWindow.sc.setViewportView(new ProJTabbedPane(temp));
			this.dispose();
		}
	}

	/**
	 * @param args
	 *            the command line arguments
	 */

	// GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton cannel;
	private javax.swing.JComboBox groups;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JButton ok;
	// End of variables declaration//GEN-END:variables

}

⌨️ 快捷键说明

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