workgrouppanel.java
来自「Java的面向对象数据库系统的源代码」· Java 代码 · 共 86 行
JAVA
86 行
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by ozone-db.org.
//
// The original code and portions created by SMB are
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
//
package org.ozoneDB.adminGui.feature.account.groups;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
//#############################################################################
/**
* This class creates the input panel that queries for the group string.
*
* @author <p align=center>Ibsen Ramos-Bonilla
* <br>Copyright © 1997-@year@ by SMB GmbH. All Rights Reserved.</p>
*
* @version 1.0
*/
//#############################################################################
public class WorkGroupPanel extends JPanel {
/** The text field used to enter the group name. */
private JTextField groupText = new JTextField();
/**
* Default constructor.
*/
public WorkGroupPanel() {
this(null);
}
/**
* Overloaded constructor.
*
* @param groupName - the group being worked on.
*/
public WorkGroupPanel(String groupName) {
super();
init(groupName);
}
/**
* This method initializes the input panel which gets the group information.
*
* @param groupName - the group being worked on.
*/
private void init(String groupName) {
this.setLayout(new GridBagLayout());
//add group section
this.add(new JLabel("Group Name:"),
new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
new Insets(10, 10, 0, 10), 0, 0));
this.add(groupText,
new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
new Insets(10, 10, 0, 10), 265, 0));
//enable/disable the group text box
if (groupName != null) {
groupText.setText(groupName);
groupText.setEnabled(false);
}
}
/**
* This method returns the group name.
*
* @return String - group name.
*/
public String getGroup() {
return groupText.getText();
}
} //--------------------------------- E O F -----------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?