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

Choice's content can not be displayed entirely in the frame.

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.1.8
    • client-libs
    • sparc
    • solaris_2.6

      JDK Version: jdk118
      OS: Solaris 2.6
      Locale: C, zh

      Choice's content can not be displayed in the Frame, and sometimes after
      remove the items of the Choice, the Choice will be displyed just as
      a short line, we can not see anything in it. Following is a short
      program to reproduce it.

      ============================CheckChoice.java============================
      import java.awt.*;
      import java.awt.event.*;
      import java.io.*;

      public class CheckChoice extends Thread {
         
         Choice choice1;
         Choice choice2;
         Choice choice3;
         int itemCount = 0;
         static CheckChoice choiceThread;

         public static void main(String args[]) {
             choiceThread = new CheckChoice();
             choiceThread.start();
         }

         public CheckChoice() {
             Frame f = new Frame("Check Choice");
             f.setLayout(new BorderLayout());
             choice1 = new Choice();
             choice2 = new Choice();
             choice3 = new Choice();
             f.add(choice1, BorderLayout.NORTH);
             f.add(choice3, BorderLayout.CENTER);
             f.add(choice2, BorderLayout.SOUTH);
             f.pack();
             f.show();
         }

         public void run() {
             while (true) {
             if (choice1 != null && itemCount < 40) {
                 choice1.add("I am Choice, yes I am : " + itemCount * itemCount);
                 choice2.add("I am the same, yes I am : "+ itemCount * itemCount);
                 choice3.add("I am the same, yes I am : "+ itemCount * itemCount);
                 itemCount ++;
             }
             if (itemCount >= 20 && choice1 != null && choice1.getItemCount() > 0) {
                 choice1.removeAll();
                 choice2.removeAll();
                 choice3.removeAll();
                 itemCount = 0;
             }
             //System.out.println("iiiiiiiii " + itemCount);
             try {
                 Thread.sleep(1000);
             } catch (Exception ex) {
             }
             }
          }
      }
      ==============================================================================

            rraysunw Richard Ray (Inactive)
            jhusunw Jim Hu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: