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

the getModifiers() return value is wrong

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1
    • client-libs
    • None
    • x86
    • windows_nt



      Name: mc57594 Date: 01/29/97


      the getModifiers() method returns 0 when the left mouse is pressed

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

      class Panel1 extends Panel {
       
         Panel1() {
             enableEvents( AWTEvent.MOUSE_EVENT_MASK |
                          AWTEvent.MOUSE_MOTION_EVENT_MASK );
         }

         public void processMouseMotionEvent( MouseEvent e ) {
            System.out.println( e.getModifiers() );
         }
       
         public void processMouseEvent( MouseEvent e ) {
            System.out.println( e.getModifiers() );
         }
       
         public void paint( Graphics g ) {
            g.fillRect( 0,0,60,60 );
         }
      }
       
      class TestEvent {
         public static void main( String args[] ){
            Frame f = new Frame( "Test" );
            f.setSize(new Dimension (300, 500));
            f.add( new Panel1() );
            f.show();
         }
       }
      ======================================================================

            amfowler Anne Fowler (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: