| 1 package org.ozoneDB.adminGui.feature.account.groups; 8 9 import java.awt.GridBagConstraints ; 10 import java.awt.GridBagLayout ; 11 import java.awt.Insets ; 12 import javax.swing.JLabel ; 13 import javax.swing.JPanel ; 14 import javax.swing.JTextField ; 15 16 17 26 28 public class WorkGroupPanel extends JPanel { 29 30 31 private JTextField groupText = new JTextField (); 32 33 34 37 public WorkGroupPanel() { 38 this(null); 39 } 40 41 46 public WorkGroupPanel(String groupName) { 47 super(); 48 init(groupName); 49 } 50 51 56 private void init(String groupName) { 57 this.setLayout(new GridBagLayout ()); 58 59 this.add(new JLabel ("Group Name:"), 61 new GridBagConstraints (0, 0, 1, 1, 0.0, 0.0, 62 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 63 new Insets (10, 10, 0, 10), 0, 0)); 64 this.add(groupText, 65 new GridBagConstraints (1, 0, 1, 1, 0.0, 0.0, 66 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 67 new Insets (10, 10, 0, 10), 265, 0)); 68 69 if (groupName != null) { 71 groupText.setText(groupName); 72 groupText.setEnabled(false); 73 } 74 } 75 76 81 public String getGroup() { 82 return groupText.getText(); 83 } 84 85 } | Popular Tags |