-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.1
-
x86
-
windows_nt
Name: sg39081 Date: 08/15/97
If you set a Scrollbar's maximum (and possibly other attributes?)
with it disabled, its peer becomes enabled (and it fires
AdjustmentEvents, etc.), however, it was never explicity enabled
and even worse, isEnabled() still returns false.
For example:
import java.awt.*;
import java.awt.event.*;
public class Main extends java.applet.Applet implements MouseMotionListener
{
Scrollbar s1 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 1);
BorderLayout bl = new BorderLayout();
public void init()
{
s1.setBackground(Color.red);
setBackground(Color.blue);
setLayout(bl);
add("North", s1);
addMouseMotionListener(this);
s1.setEnabled(false);
}
public void mouseDragged(MouseEvent e)
{
s1.setMaximum(e.getX());
System.out.println("mouse dragged, scrollbar max set to:
"+s1.getMaximum()+", isEnabled: "+s1.isEnabled());
}
public void mouseMoved(MouseEvent e) {}
}
company - Corel , email - ###@###.###
======================================================================
I have a similar complaint from another licensee :
If setValue is used on a disabled ScrollBar it becomes enabled (i.e. not
grey out).
Since there is a simple workaround (check if the scrollbar is enabled
before setting the value) the impact is low - but this is a bug.
mick.fleming@Ireland 1998-03-05
=============================================================================
- duplicates
-
JDK-4114433 Scrollbar.setValues can enable or disable peer silently (win32)
-
- Closed
-