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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.0.2, 1.1, 1.3.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic, x86, sparc
    • OS:
      solaris_2.5.1, solaris_2.6, windows_nt

      Description



      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 - ###@###.###
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: