Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4031460

Empty choice alignment is off. Fixed when add item to choice.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.0.2, 1.1, 1.3.0
    • client-libs
    • generic, x86, sparc
    • solaris_2.5.1, solaris_2.6, windows_nt



      Name: mc57594 Date: 02/10/97


      Here's the code, I've kept it as brief as possible!
      /***************************************/
      import java.awt.*;

      public class Login extends Frame
      {
      protected Button btnLogin;
      protected Button btnNewUser;
      protected Choice chcUsers;

      public Login ()
      {
      GridBagConstraints gbc;
      GridBagLayout gb;
      Label lbl;
      Panel pnl;

      gb = new GridBagLayout ();
      setLayout (gb);

      // create components
      btnLogin = new Button ("Login");
      btnNewUser = new Button ("New User...");
      chcUsers = new Choice ();

      /*** UNCOMMENTING THIS LINE WILL FIX THE ALIGNMENT ***/
      // chcUsers.add ("THIS FIXES IT");

      lbl = new Label ("Name:");
      gbc = new GridBagConstraints ();
      gbc.anchor = GridBagConstraints.EAST;
      gb.setConstraints (lbl, gbc);
      add (lbl);

      gbc = new GridBagConstraints ();
      gbc.anchor = GridBagConstraints.WEST;
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      gb.setConstraints (chcUsers, gbc);
      add (chcUsers);

      pnl = new Panel ();
      pnl.setLayout (new GridLayout (1, 0, 10, 0));
      pnl.add (btnLogin);
      pnl.add (btnNewUser);

      gbc = new GridBagConstraints ();
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      gb.setConstraints (pnl, gbc);
      add (pnl);

      pack ();
      }
      public static void main (String args[])
      {
      Login login = new Login ();
      login.show ();
      }
      }

      company - Princeton University - Student , email - ###@###.###
      ======================================================================

            ssisunw Ssi Ssi (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: