-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.4, 1.1.5, 1.2.0
-
generic, x86
-
generic, windows_95, windows_nt
Name: joT67522 Date: 10/22/97
The MouseEvents that get fired by clicking on a Scrollbar seem to be as follows:
Left Button: MOUSE_PRESSED
Right Button: MOUSE_PRESSED, MOUSE_CLICKED, MOUSE_RELEASED
I found this out by putting a System.out.println(event) in each of the MouseListener
methods, where event is a MouseEvent.
I wanted to determine when the user has let go of the scroll bar bubble after performing
a TRACK adjustment, in an attempt to allow tracking while disabling the "live" tracking
-- like the scrollbar worked in older mac os's. This is necessary becuase the scrollbar
value controls what page of data in a listbox to display. With the "live" tracking, the
listbox is too slow with its updates.
Just click on the scrollbar with the right and then the
left button and watch your console window.
import java.awt.*;
import java.awt.event.*;
class ButtonTest extends Frame implements AdjustmentListener,
MouseListener
{
public ButtonTest()
{
super("blah");
BorderLayout layout = new BorderLayout();
setLayout(layout);
turnPage = new Scrollbar(Scrollbar.HORIZONTAL);
List someList = new List(15);
Panel middle = new Panel(new BorderLayout());
middle.add("North", someList);
middle.add("South", turnPage);
add("Center", middle);
turnPage.addAdjustmentListener(this);
turnPage.addMouseListener(this);
turnPage.setValues(0, 1, 0, 15);
pack();
}
public static void main(String argv[]) {
ButtonTest bt = new ButtonTest();
bt.setVisible(true);
}
public void adjustmentValueChanged(AdjustmentEvent event)
{
}
public void mouseClicked(MouseEvent event){
System.out.println(event);
}
public void mouseEntered(MouseEvent event){
System.out.println(event);
}
public void mouseExited(MouseEvent event){
System.out.println(event);
}
public void mousePressed(MouseEvent event){
System.out.println(event);
}
public void mouseReleased(MouseEvent event){
System.out.println(event);
}
private Scrollbar turnPage;
}
======================================================================
- duplicates
-
JDK-4318862 Mouse Events not triggered properly
-
- Closed
-
- relates to
-
JDK-4087087 eou: Loss of Mouse Events when using Class Scrollbar
-
- Closed
-
-
JDK-4034982 WinNT: Scrollbars don't receive mouseDragged events
-
- Closed
-
-
JDK-4137888 PopupMenu is not working with 1.1.5 (while it is working fine with 1.1.4)!!!
-
- Closed
-