Java Code Examples for javax.swing.JLabel.setAlignmentX()

The following are Jave code examples for showing how to use setAlignmentX() of the javax.swing.JLabel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: SE2017-Team2   File: InitPage.java   Source Code and License Vote up 6 votes
public InitPage(Menu crMenu) {
	this.crMenu = crMenu;

	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
	JButton newPetriButton = new JButton("New Petri Net");
	JButton newCrButton = new JButton("New CR Graph");

	newCrButton.addActionListener(this);
	newCrButton.setActionCommand("new_cr");
	newCrButton.setAlignmentX(Component.CENTER_ALIGNMENT);

	newPetriButton.addActionListener(this);
	newPetriButton.setActionCommand("new_petri");
	newPetriButton.setAlignmentX(Component.CENTER_ALIGNMENT);

	JLabel statusLabel = new JLabel("Please create a new graph");
	statusLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	// statusLabel.setLocation(150, 150);

	add(statusLabel);
	add(newCrButton);
	add(newPetriButton);

}
 
Example 2
Project: chipKIT-importer   File: ProgressTrackingPanel.java   Source Code and License Vote up 6 votes
private JComponent createImportInProgressPane() {
    JLabel infoLabel = new JLabel( NbBundle.getMessage( ProgressTrackingPanel.class, "ProgressTrackingPanel.importInProgressMessage" ) );
    infoLabel.setAlignmentX(0.5f);

    JXBusyLabel busyLabel = new JXBusyLabel( new Dimension(48, 48) );
    busyLabel.setAlignmentX(0.5f);
    busyLabel.setBusy(true);

    JPanel p1 = new JPanel();
    p1.setLayout(new BoxLayout(p1, BoxLayout.PAGE_AXIS));
    p1.add(infoLabel);
    p1.add(Box.createVerticalStrut(20));
    p1.add(busyLabel);
    
    return p1;
}
 
Example 3
Project: incubator-netbeans   File: ExpandableMessage.java   Source Code and License Vote up 5 votes
ExpandableMessage(String topMsgKey,
                  Collection<String> messages,
                  String bottomMsgKey,
                  JButton toggleButton) {
    super(null);
    this.messages = messages;
    this.toggleButton = toggleButton;
    lblTopMsg = new JLabel(getMessage(topMsgKey));
    lblBotMsg = (bottomMsgKey != null)
                ? new JLabel(getMessage(bottomMsgKey))
                : null;

    setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));

    add(lblTopMsg);
    lblTopMsg.setAlignmentX(LEFT_ALIGNMENT);

    if (lblBotMsg != null) {
        add(makeVerticalStrut(lblTopMsg, lblBotMsg));
        add(lblBotMsg);
        lblBotMsg.setAlignmentX(LEFT_ALIGNMENT);
    }

    Mnemonics.setLocalizedText(toggleButton,
                               getMessage("LBL_ShowMoreInformation")); //NOI18N
    toggleButton.addActionListener(this);
}
 
Example 4
Project: polyevent   File: LoginView.java   Source Code and License Vote up 5 votes
/**
 * Affiche les �lements graphiques sur la fen�tre
 */
private void afficher() {
	this.panPrinc = new JPanel();
	this.panPrinc.setLayout(new BoxLayout(this.panPrinc, BoxLayout.PAGE_AXIS));

	//Label identifiant
	JLabel labIdentifiant = new JLabel("Identifiant");
	labIdentifiant.setFont(new Font("Arial", Font.PLAIN, 20));
	labIdentifiant.setAlignmentX(Component.CENTER_ALIGNMENT);

	//Label mot de passe
	JLabel labMdp = new JLabel("Mot de passe");
	labMdp.setFont(new Font("Arial", Font.PLAIN, 20));
	labMdp.setAlignmentX(Component.CENTER_ALIGNMENT);

	//Champ de l'identifiant
	this.fieldName = new JTextField();
	this.fieldName.setPreferredSize(new Dimension(150,25));
	this.fieldName.setAlignmentX(Component.CENTER_ALIGNMENT);

	//Champ du mot de passe
	this.fieldPassword = new JPasswordField();
	this.fieldPassword.setEchoChar('*');
	this.fieldPassword.setPreferredSize(new Dimension(150,25));
	this.fieldPassword.setAlignmentX(Component.CENTER_ALIGNMENT);

	//Bouton connecter
	butConnecter = new JButton();
	butConnecter.setAlignmentX(Component.CENTER_ALIGNMENT);

	this.panPrinc.add(Box.createVerticalStrut(180));
	this.panPrinc.add(labIdentifiant);
	this.panPrinc.add(this.fieldName);
	this.panPrinc.add(Box.createVerticalStrut(10));
	this.panPrinc.add(labMdp);
	this.panPrinc.add(this.fieldPassword);
	this.panPrinc.add(Box.createVerticalStrut(40));
	this.panPrinc.add(butConnecter);
}
 
Example 5
Project: VASSAL-src   File: AboutWindow.java   Source Code and License Vote up 5 votes
public AboutWindow(Window w, BufferedImage img, String text) {
  super(w);

  getContentPane().setBackground(Color.black);
  setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));

  final JLabel l1 = new JLabel(new ImageIcon(img));
  l1.setAlignmentX(0.5F);
  add(l1);

  final JLabel l2 = new JLabel(text);
  l2.setBackground(Color.blue);
  l2.setForeground(Color.white);
  l2.setHorizontalAlignment(JLabel.CENTER);
  l2.setAlignmentX(0.5F);
  add(l2);

  pack();

  final Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
  setLocation(d.width / 2 - getWidth() / 2,
              d.height / 2 -getHeight() / 2);

  addMouseListener(new MouseAdapter() {
    public void mouseReleased(MouseEvent evt) {
      setVisible(false);
      dispose();
    }
  });
}
 
Example 6
Project: EasyDragDrop   File: MainFrame.java   Source Code and License Vote up 5 votes
private void DragFileHandle(final JPanel myPanel) {
    new FileDrop(myPanel, new FileDrop.Listener() {
        public void filesDropped(java.io.File[] files) {
            for (int i = 0; i < files.length; i++) {
                Icon ico = FileSystemView.getFileSystemView().getSystemIcon(files[i]);
                FindFiles(myPanel.getName(), files[i]);
                Image image = ((ImageIcon) ico).getImage();
                ImageIcon icon = new ImageIcon(getScaledImage(image, 45, 45));

                myPanel.removeAll();
                myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.Y_AXIS));

                JLabel label = new JLabel();
                label.setIcon(icon);
                label.setAlignmentX(CENTER_ALIGNMENT);

                myPanel.add(Box.createRigidArea(new Dimension(0, 60)));
                myPanel.add(label, BorderLayout.CENTER);

                GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
                JLabel labe2 = new JLabel(files[i].getName(), SwingConstants.CENTER);
                labe2.setBackground(new Color(240, 240, 240));
                labe2.setForeground(new Color(0, 0, 0));
                labe2.setFont(new Font("Segoe UI Light", Font.PLAIN, 14));
                labe2.setAlignmentX(CENTER_ALIGNMENT);

                myPanel.add(labe2, BorderLayout.LINE_START);
            }
        }
    });
}
 
Example 7
Project: JavaGraph   File: ExploreAction.java   Source Code and License Vote up 5 votes
/**
 * Returns the frames-per-second slider for the animation dialog.
 */
final JPanel getAnimationPanel() {
    // lazily create the label
    if (this.animationPanel == null) {
        JLabel label = new JLabel("Animation Speed");
        label.setAlignmentX(Component.CENTER_ALIGNMENT);
        final JSlider slider = new JSlider(SwingConstants.HORIZONTAL, 1, 10, 2) {
            @Override
            public void updateUI() {
                setUI(BasicSliderUI.createUI(this));
            }
        };
        slider.setMajorTickSpacing(9);
        slider.setMinorTickSpacing(1);
        slider.setSnapToTicks(true);
        slider.setPaintTicks(true);
        slider.setPaintLabels(true);
        slider.setFocusable(false);
        slider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                int speed = slider.getValue();
                setSpeed(speed);
            }
        });
        slider.setAlignmentX(Component.CENTER_ALIGNMENT);
        this.animationPanel = new JPanel();
        this.animationPanel.setLayout(new BoxLayout(this.animationPanel, BoxLayout.Y_AXIS));
        this.animationPanel.add(label);
        this.animationPanel.add(slider);
    }
    return this.animationPanel;
}
 
Example 8
Project: jaer   File: MultiInputPanel.java   Source Code and License Vote up 5 votes
/** Add a source controller that changes the packet source streams upon selection */
        public SourceControl(final ArrayList<PacketStream> sources, final ProcessingNetwork.Node f, final String name, final int sourceIndex) {
            super();
            filter = f;
            setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
            setAlignmentX(LEFT_ALIGNMENT);
            final JLabel label = new JLabel(name);
            label.setAlignmentX(LEFT_ALIGNMENT);
            label.setFont(label.getFont().deriveFont(fontSize));
//            addTip(f, label);
                        
            add(label);

            String[] names=new String[sources.size()];
            for (int i=0; i<sources.size();i++)
                names[i]=sources.get(i).getName();
                        
            control = new JComboBox(names);
            control.setFont(control.getFont().deriveFont(fontSize));
//            control.setHorizontalAlignment(SwingConstants.LEADING);
            
            control.addActionListener(new ActionListener(){

                @Override
                public void actionPerformed(ActionEvent e) {
                    try {
                        node.setSource(sourceIndex, sources.get(control.getSelectedIndex()));
                    } catch (Exception ex) {
                        node.setEnabled(false);
                        Logger.getLogger(MultiInputPanel.class.getName()).log(Level.SEVERE, "Source index higher than number of sources", ex);
                    }
                }
            });
            
            
            add(label);
            add(control);
            
            
        }
 
Example 9
Project: jaer   File: ParameterControlPanel.java   Source Code and License Vote up 5 votes
public EnumControl(final Class<? extends Enum> c, final Object f, PropertyDescriptor p) {
            super();
            final String name = p.getName();
            final Method r = p.getReadMethod(), w = p.getWriteMethod();

            setterMap.put(name, this);
            clazz = f;
            write = w;
            read = r;
            setLayout(new GridLayout(1, 0));
//            setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
            setAlignmentX(ALIGNMENT);
            final JLabel label = new JLabel(name);
            label.setAlignmentX(ALIGNMENT);
            label.setFont(label.getFont().deriveFont(fontSize));
            addTip(p, label);
            add(label);

            control = new JComboBox(c.getEnumConstants());
            control.setFont(control.getFont().deriveFont(fontSize));
//            control.setHorizontalAlignment(SwingConstants.LEADING);

            add(label);
            add(control);
            refresh();
            control.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    try {
                        w.invoke(clazz, control.getSelectedItem());
                    } catch (Exception e2) {
                        e2.printStackTrace();
                    }
                }
            });
        }
 
Example 10
Project: jaer   File: ParameterControlPanel.java   Source Code and License Vote up 5 votes
public StringControl(final Object f, PropertyDescriptor p) {
            super();
            final String name = p.getName();
            final Method r = p.getReadMethod(), w = p.getWriteMethod();

            setterMap.put(name, this);
            clazz = f;
            write = w;
            read = r;
            setLayout(new GridLayout(1, 0));
//            setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
            setAlignmentX(ALIGNMENT);
            final JLabel label = new JLabel(name);
            label.setAlignmentX(ALIGNMENT);
            label.setFont(label.getFont().deriveFont(fontSize));
            addTip(p, label);
            add(label);

            textField = new JTextField(name);
            textField.setFont(textField.getFont().deriveFont(fontSize));
            textField.setHorizontalAlignment(SwingConstants.LEADING);
            textField.setColumns(10);

            add(label);
            add(textField);
            refresh();
            textField.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    try {
                        w.invoke(clazz, textField.getText());
                    } catch (Exception e2) {
                        e2.printStackTrace();
                    }
                }
            });
        }
 
Example 11
Project: VASSAL-src   File: BoardSlot.java   Source Code and License Vote up 4 votes
public BoardSlot(BoardPicker bp, String prompt) {
  this.prompt = prompt;
  picker = bp;
  boards = new JComboBox();
  boards.addItem(prompt);

  final String lbn[] = picker.getAllowableLocalizedBoardNames();
  for (String s : lbn) {
    boards.addItem(s);
  }
  boards.setSelectedIndex(lbn.length == 1 ? 1 : 0);
  boards.addActionListener(this);

  reverseCheckBox =
    new JCheckBox(Resources.getString("BoardPicker.flip")); //$NON-NLS-1$
  reverseCheckBox.addItemListener(new ItemListener() {
    public void itemStateChanged(ItemEvent e) {
      if (getBoard() != null) {
        getBoard().setReversed(reverseCheckBox.isSelected());
        picker.repaint();
      }
    }
  });

  reverseCheckBox.setVisible(false);

  setLayout(new OverlayLayout(this));

  final JPanel p = new JPanel();
  final Box b = Box.createHorizontalBox();
  b.add(boards);
  b.add(reverseCheckBox);
  p.add(b);
  p.setOpaque(false);
  p.setAlignmentX(0.5F);
  final JLabel l = new JLabel(this);
  l.setAlignmentX(0.5F);

  add(p);
  add(l);

  actionPerformed(null);
}
 
Example 12
Project: VASSAL-src   File: WizardSupport.java   Source Code and License Vote up 4 votes
protected JComponent getNameControls(final WizardController controller, final Map settings) {
  if (nameControls == null) {
    Box box = Box.createVerticalBox();
    box.add(Box.createVerticalGlue());
    controller.setProblem(Resources.getString("WizardSupport.EnterNameAndPassword")); //$NON-NLS-1$
    final StringConfigurer nameConfig = new StringConfigurer(null, Resources.getString("WizardSupport.RealName")); //$NON-NLS-1$
    final StringConfigurer pwd = new PasswordConfigurer(null, Resources.getString("WizardSupport.Password")); //$NON-NLS-1$
    final StringConfigurer pwd2 = new PasswordConfigurer(null, Resources.getString("WizardSupport.ConfirmPassword")); //$NON-NLS-1$
    PropertyChangeListener pl = new PropertyChangeListener() {
      @SuppressWarnings("unchecked")
      public void propertyChange(PropertyChangeEvent evt) {
        settings.put(GameModule.REAL_NAME, nameConfig.getValue());
        settings.put(GameModule.SECRET_NAME, pwd.getValue());
        if (nameConfig.getValue() == null || "".equals(nameConfig.getValue())) { //$NON-NLS-1$
          controller.setProblem(Resources.getString("WizardSupport.EnterYourName")); //$NON-NLS-1$
        }
        else if (pwd.getValue() == null || "".equals(pwd.getValue())) { //$NON-NLS-1$
          controller.setProblem(Resources.getString("WizardSupport.EnterYourPassword")); //$NON-NLS-1$
        }
        else if (!pwd.getValue().equals(pwd2.getValue())) {
          controller.setProblem(Resources.getString("WizardSupport.PasswordsDontMatch")); //$NON-NLS-1$
        }
        else {
          final Prefs p = GameModule.getGameModule().getPrefs();

          p.getOption(GameModule.REAL_NAME)
           .setValue(nameConfig.getValueString());

          p.getOption(GameModule.SECRET_NAME)
           .setValue(pwd.getValueString());

          try {
            p.save();
            controller.setProblem(null);
          }
          // FIXME: review error message
          catch (IOException e) {
            String msg = e.getMessage();
            if (msg == null) {
              msg = Resources.getString("Prefs.unable_to_save");
            }
            controller.setProblem(msg);
          }
        }
      }
    };
    nameConfig.addPropertyChangeListener(pl);
    pwd.addPropertyChangeListener(pl);
    pwd2.addPropertyChangeListener(pl);
    box.add(nameConfig.getControls());
    box.add(pwd.getControls());
    box.add(pwd2.getControls());
    JLabel l = new JLabel(Resources.getString("WizardSupport.NameAndPasswordDetails"));
    l.setAlignmentX(Box.CENTER_ALIGNMENT);
    box.add(l);
    box.add(Box.createVerticalGlue());
    nameControls = box;
  }
  return nameControls;
}
 
Example 13
Project: AI-RRT-Motion-Planning   File: Visualiser.java   Source Code and License Vote up 4 votes
private void createAnimationControls() {
	Font sliderFont = new Font("Arial", Font.PLAIN, 12);

	animationControls = new JPanel();
	animationControls.setLayout(new BoxLayout(animationControls,
			BoxLayout.PAGE_AXIS));

	JLabel manualLabel = new JLabel("Frame #");
	manualLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	manualSlider = new JSlider(JSlider.HORIZONTAL);
	manualSlider.setPaintTicks(true);
	manualSlider.setPaintLabels(true);
	manualSlider.setFont(sliderFont);
	manualSlider.addChangeListener(manualSliderListener);
	manualSlider.addMouseListener(manualSliderClickListener);
	manualSlider.setMinorTickSpacing(1);
	manualSlider.addComponentListener(resizeListener);

	JLabel framerateLabel = new JLabel("Framerate");
	framerateLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	framerateSlider = new JSlider(JSlider.HORIZONTAL, FRAMERATE_MIN,
			FRAMERATE_MAX, FRAMERATE_INIT);
	framerateSlider.setMajorTickSpacing(10);
	framerateSlider.setMinorTickSpacing(1);
	framerateSlider.setPaintTicks(true);
	framerateSlider.setPaintLabels(true);
	framerateSlider.setLabelTable(framerateSlider.createStandardLabels(10,
			10));
	framerateSlider.setFont(sliderFont);
	framerateSlider.addChangeListener(framerateListener);
	JPanel frameratePanel = new JPanel();
	frameratePanel.setLayout(new BoxLayout(frameratePanel,
			BoxLayout.PAGE_AXIS));
	frameratePanel.add(framerateLabel);
	frameratePanel.add(Box.createRigidArea(new Dimension(0, 2)));
	frameratePanel.add(framerateSlider);

	playPauseButton = new JButton(playIcon);
	playPauseButton.addActionListener(playPauseListener);
	stopButton = new JButton(stopIcon);
	stopButton.addActionListener(stopListener);

	animationControls.add(new JSeparator(JSeparator.HORIZONTAL));
	animationControls.add(Box.createRigidArea(new Dimension(0, 2)));
	animationControls.add(manualLabel);
	animationControls.add(Box.createRigidArea(new Dimension(0, 2)));
	animationControls.add(manualSlider);
	animationControls.add(Box.createRigidArea(new Dimension(0, 5)));
	JPanel p2 = new JPanel();
	p2.setLayout(new BoxLayout(p2, BoxLayout.LINE_AXIS));
	p2.add(playPauseButton);
	p2.add(Box.createRigidArea(new Dimension(10, 0)));
	p2.add(stopButton);
	p2.add(frameratePanel);
	animationControls.add(p2);
	animationControls.setVisible(false);
	animationControls.setBorder(BorderFactory.createEmptyBorder(0, 10, 5,
			10));
	container.add(animationControls, BorderLayout.SOUTH);
}
 
Example 14
Project: gate-core   File: ProgressPanel.java   Source Code and License Vote up 4 votes
public ProgressPanel() {
  super();

  setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

  progressTotal = new SafeJProgressBar();
  progressTotal.setAlignmentX(CENTER_ALIGNMENT);
  progressTotal.setMaximumSize(new Dimension(250, progressTotal
          .getPreferredSize().height));
  progressTotal.setIndeterminate(true);

  progressSingle = new SafeJProgressBar();
  progressSingle.setAlignmentX(CENTER_ALIGNMENT);
  progressSingle.setMaximumSize(new Dimension(250, progressTotal
          .getPreferredSize().height));
  progressSingle.setIndeterminate(true);
  progressSingle.setVisible(false);
  progressSingle.setMinimum(0);
  progressSingle.setMaximum(100);

  message = new JLabel("");
  message.setIcon(new ProgressIcon(48, 48));
  message.setHorizontalTextPosition(SwingConstants.RIGHT);
  message.setHorizontalAlignment(SwingConstants.CENTER);
  message.setAlignmentX(CENTER_ALIGNMENT);

  dlMsg = new JLabel("Downloading CREOLE Plugin...");
  dlMsg.setIcon(new DownloadIcon(48, 48));
  dlMsg.setHorizontalTextPosition(SwingConstants.RIGHT);
  dlMsg.setHorizontalAlignment(SwingConstants.CENTER);
  dlMsg.setAlignmentX(CENTER_ALIGNMENT);
  dlMsg.setVisible(false);

  add(Box.createVerticalGlue());
  add(message);
  add(Box.createVerticalStrut(5));
  add(progressTotal);
  add(Box.createVerticalStrut(10));
  add(dlMsg);
  add(Box.createVerticalStrut(5));
  add(progressSingle);
  add(Box.createVerticalGlue());

  addComponentListener(this);
}
 
Example 15
Project: jaer   File: ParameterControlPanel.java   Source Code and License Vote up 4 votes
public BooleanControl(final Object f, PropertyDescriptor p) {
            super();
            final String name = p.getName();
            final Method r = p.getReadMethod(), w = p.getWriteMethod();

            setterMap.put(name, this);
            clazz = f;
            write = w;
            read = r;
            setLayout(new GridLayout(1, 0));
//         setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
            setAlignmentX(ALIGNMENT);
//            setLayout(new FlowLayout(FlowLayout.LEADING));
            JLabel label=new JLabel(name);
            label.setAlignmentX(ALIGNMENT);
            label.setHorizontalTextPosition(SwingConstants.LEFT);
            label.setFont(label.getFont().deriveFont(fontSize));
            add(label);
            addTip(p,label);

            checkBox = new JCheckBox();
            refresh();
            checkBox.setAlignmentX(ALIGNMENT);
            checkBox.setHorizontalAlignment(SwingConstants.LEFT);
            checkBox.setHorizontalTextPosition(SwingConstants.LEFT);
//            checkBox.setBorder(new EmptyBorder(0,0,0,0));
//            Border border=checkBox.getBorder();
//            Insets insets=border.getBorderInsets(this);
//            insets.left=0;
            addTip(p, checkBox);
            add(checkBox);

            checkBox.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    try {
                        w.invoke(clazz, checkBox.isSelected());
                    } catch (InvocationTargetException ite) {
                        ite.printStackTrace();
                    } catch (Exception iae) {
                        iae.printStackTrace();
                    }
                }
            });
        }
 
Example 16
Project: Reinickendorf_SER316   File: TaigaCredentialsWizardStep.java   Source Code and License Vote up 4 votes
/**
 * Create the panel.
 */
public TaigaCredentialsWizardStep() {
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
	
	JLabel instructionsLabel = new JLabel("Enter your Taiga credentials below:");
	instructionsLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	add(instructionsLabel);
	
	JPanel panel = new JPanel();
	add(panel);
	GridBagLayout gbl_panel = new GridBagLayout();
	gbl_panel.columnWidths = new int[]{63, 18, 0};
	gbl_panel.rowHeights = new int[]{14, 20, 20, 0};
	gbl_panel.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
	gbl_panel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
	panel.setLayout(gbl_panel);
	
	JLabel label = new JLabel("Username:");
	GridBagConstraints gbc_label = new GridBagConstraints();
	gbc_label.insets = new Insets(0, 0, 5, 5);
	gbc_label.gridx = 0;
	gbc_label.gridy = 0;
	panel.add(label, gbc_label);
	
	usernameField = new JTextField();
	GridBagConstraints gbc_usernameField = new GridBagConstraints();
	gbc_usernameField.fill = GridBagConstraints.HORIZONTAL;
	gbc_usernameField.insets = new Insets(0, 0, 5, 0);
	gbc_usernameField.gridx = 1;
	gbc_usernameField.gridy = 0;
	panel.add(usernameField, gbc_usernameField);
	usernameField.setColumns(10);
	
	JLabel label_1 = new JLabel("Password:");
	GridBagConstraints gbc_label_1 = new GridBagConstraints();
	gbc_label_1.insets = new Insets(0, 0, 5, 5);
	gbc_label_1.gridx = 0;
	gbc_label_1.gridy = 1;
	panel.add(label_1, gbc_label_1);
	
	passwordField = new JPasswordField();
	GridBagConstraints gbc_passwordField = new GridBagConstraints();
	gbc_passwordField.fill = GridBagConstraints.HORIZONTAL;
	gbc_passwordField.insets = new Insets(0, 0, 5, 0);
	gbc_passwordField.gridx = 1;
	gbc_passwordField.gridy = 1;
	panel.add(passwordField, gbc_passwordField);
}