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

📄 workgrouppanel.java

📁 Java的面向对象数据库系统的源代码
💻 JAVA
字号:
// 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 &copy 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -