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

MToolkit: no MouseEvents are generated for Left and Right

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 5.0
    • client-libs
    • None
    • sparc
    • solaris_8



      Name: adR10249 Date: 11/18/2003


      There are no "MouseReleased" and "MouseClicked" events generated by the code
      below with MToolkit. It works fine with XAWT.

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

      public class ScrollBarTest implements MouseListener {
          Frame frame;
          Scrollbar scrollBar ;
          public ScrollBarTest() {
              frame=new Frame();
              frame.setTitle("Motif Scroll Bar Test");
              frame.setLayout(new FlowLayout());
              
              scrollBar = new Scrollbar(Scrollbar.VERTICAL, 0, 60, 0, 400);

              scrollBar.addMouseListener(this);
              frame.add(scrollBar);

              frame.setBackground(Color.red);
              frame.setSize(500,200);
              frame.setVisible(true);
              frame.toFront();
          }

          public void mousePressed(MouseEvent e ){
              System.out.println("in mouse Pressed");
          }
          public void mouseClicked(MouseEvent e ){
              System.out.println("in mouse Clicked");
          }
          public void mouseReleased(MouseEvent e ){
              System.out.println("in mouse Released");
          }
          public void mouseExited(MouseEvent e ){ }
          public void mouseEntered(MouseEvent e ){ }
          
          public static void main(String args[]){
              ScrollBarTest avt = new ScrollBarTest();
          }
      }

      ======================================================================

            ant Anton Tarasov (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: