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

MAWT: ScrollBar falls outside width of List in Unix and Flickering when element added

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.4.0
    • client-libs
    • x86
    • solaris_8

      Name: rmT116609 Date: 08/27/2001


      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
      Classic VM (build 1.3.1-b24, native threads, nojit)



      The problem is observed in jdk1.2.2 higher version on SOLARIS 8.0
      -----------------------------------------------------------------------

      In case of Windows environment when more number of items are added to the List
      the scroll bar appears inside the List box width. Where as in UNIX environment
      when scroll bar appears it falls outside the List box width and sometimes even
      over the component adjacent to it.The scroll bar width is added to the original
      width of the List box.

      Also when an element is added to List, say by click of a button the List height
      seems to change.This causes an observable flickering problem when the elements
      are added in the List. I am able to observe a perceivable difference in the
      height of the List box getting decreased immedaitely when an element is added
      to it. Kindly give us a solution to the above specified problem.

      import java.awt.*;
      import java.awt.event.*;

      public class ListProb extends Dialog implements
      ActionListener,KeyListener,WindowListener
      {
      TextField tf,tf1;
      Button b;
      Dialog d;
      List l;

      ListProb(Frame f,boolean bln)
      {
      super(f,bln);
      setLayout(new FlowLayout());

      tf = new TextField(30);
      tf1 = new TextField(30);
      tf.addKeyListener(this);
      tf1.addKeyListener(this);
      b = new Button("click");
      b.addActionListener(this);
      b.addKeyListener(this);
      l = new List(5);
      add(l);
      add(tf1);
      add(b);
      addWindowListener(this);
      }

      public void actionPerformed(ActionEvent ae)
      {
      if(ae.getSource()==b)
      {
      String str = tf1.getText();
      l.add(str);
      }
      }
      public void keyPressed(KeyEvent ke)
      {
      }
      public void keyReleased(KeyEvent ke)
      {

      }

      public void keyTyped(KeyEvent ke)
      {
      }

      public void windowClosing(java.awt.event.WindowEvent event)
      {
      dispose();
      System.exit(0);
      }

      public void windowOpened(WindowEvent we)
      {
      }
      public void windowActivated(WindowEvent we)
      {
      }
      public void windowDeactivated(WindowEvent we)
      {
      }
      public void windowIconified(WindowEvent we)
      {
      }
      public void windowDeiconified(WindowEvent we)
      {
      }
      public void windowClosed(WindowEvent we)
      {
      }
      public static void main(String args[])
      {
      ListProb dlg =new ListProb(new Frame(), true);
      dlg.setSize(350,250);
      dlg.setVisible(true);
      }
      }
      (Review ID: 130705)
      ======================================================================

            dcherepanov Dmitry Cherepanov
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: