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

JScrollBar delay after initialization on solaris8

XMLWordPrintable

    • 2d
    • x86
    • generic



      Name: jbT81659 Date: 12/19/99

      JScrollBar takes extra time to respond to mouse drag under solaris8
      To reproduce bug:
      Compile and run the following code under solaris8
      Use the mouse to drag the horizontal or vertical scrollbar
      note it takes >6-10 seconds for JSCrollBar to respond on a 450 MHZ machine

      -------Code------
      /* Copyright (c) Sun Microsystems 1998

      $Header: /home/sun/src/JDK1.2/jScrollBar.java,v 1.10 1999/11/30 13:26:44 isam Exp $

      */

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class jScrollBar extends JApplet
      {
        public void init()
        {
          ScrollBarExample sbe = new ScrollBarExample();
          getContentPane().add(sbe);

        }

        public static void main(String[] argv)
        {

          //JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
          JFrame frame = new JFrame("ABCDEFG");
          frame.setContentPane(new ScrollBarExample());
          frame.setSize(300,300);
          frame.setVisible(true);

        }

      }

      class ScrollBarExample extends JPanel
      {
         JPanel p;
        JLabel label;
        public ScrollBarExample()
        {
          super(true);
          label=new JLabel();
          setLayout(new BorderLayout());
          JScrollBar hbar=new JScrollBar(JScrollBar.HORIZONTAL, 30, 20, 0, 300);
          JScrollBar vbar=new JScrollBar(JScrollBar.VERTICAL, 30, 40, 0, 300);
          hbar.setUnitIncrement(2);
          hbar.setBlockIncrement(1);
          hbar.addAdjustmentListener(new MyAdjustmentListener());
          vbar.addAdjustmentListener(new MyAdjustmentListener());
          setBackground(Color.white);
          add(hbar, BorderLayout.SOUTH);
          add(vbar, BorderLayout.EAST);
          add(label, BorderLayout.CENTER);
        }

        class MyAdjustmentListener implements AdjustmentListener
        {
          public void adjustmentValueChanged(AdjustmentEvent e)
          {
            label.setFont(new Font("Lucida Sans Regular",Font.PLAIN,14));
            //label.setText("\u0627\u0644\u0642\u064a\u0645\u0629\u0020\u0627\u0644\u062c\u062f\u064a\u062f\u0629 " + e.getValue() + " ");
            label.setText("Value is " + e.getValue() + " ");
            repaint();
          }
        }
      }


      WorkAround:
      ======================================================================
      benavrhm@israel 2000-01-12

      Please see the X Evaluation field of this report. I re-opened this report because the workarounds suggested by steve.wilson@Eng 1999-12-20 and parry.kejriwal@eng 1999-12-21 are not adequate when you need to use the same JRE for both AWT and Swing.

      benavrhm@israel 2000-01-12

            pkejriwasunw Parry Kejriwal (Inactive)
            jbenavrasunw Jonathan Benavraham (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: