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

screen can be frozen when interacting with MB3 using AWT on Motif

XMLWordPrintable

    • b03
    • sparc
    • solaris_2.6


        chosho.kyo@japan 1998-10-09

        (1) Working environments
        OS : Solaris2.5.1J, Solaris2.6J
        JAVA : java full version "JDK1.1.6N"
        JRE : jre1.1.6FCS

        (2) Phenomenon
            The mouse and whole screen becomes frozen.
            A source named PopupMouse.java is attached to be able to reproduce
            this phenomenon.

        [Step1] Compile PopupMouse.java
        [Step2] Run JRE: jre PopupMouse or java PopupMouse
                A frame AWTapp appears.
        [Step3] Click the Mouse Button(MB3) on the frame,
                and a popup menu will be showed.
        [Step4] Just click MB3 many times (i.e. 10 - 30 times) on the frame,
                then you will find the mouse and whole screen becomes frozen.
                The only way to defrost screen is to kill the process of jre or java
                on another machine.

        //------------PopupMouse.java Start-----------------
        import java.awt.*;
        import java.awt.event.*;

        public class PopupMouse extends Frame implements MouseListener{
                public MenuItem lsItem1, lsItem2;
                public PopupMenu pm;
                public Canvas cv;

        public PopupMouse(){
        setSize(500,300);
        setLayout(null);

                        cv = new Canvas();
                        cv.setSize(500,300);
                        cv.setLocation(0,0);
                        cv.addMouseListener(this);
                        add(cv);

                        lsItem1 = new MenuItem("Item1");
                        lsItem2 = new MenuItem("Item2");
                        
                        pm = new PopupMenu("PopupMenu");
                        pm.add(lsItem1);
                        pm.add(lsItem2);
                        add(pm);
        setVisible(true);
        }

                public void mouseClicked(MouseEvent e){

                }
                
                public void mousePressed(MouseEvent e){
                       System.out.println("MousePressed " + e.getModifiers());
                       if(e.isPopupTrigger() == true){
                             pm.show(cv,e.getX(),e.getY());
                       }
                 }
                
                public void mouseReleased(MouseEvent e){
                }
                
                public void mouseEntered(MouseEvent e){
                }
                
                public void mouseExited(MouseEvent e){
                }

        static public void main(String str[]){
        new PopupMouse();
        }
        }

        //------------PopupMouse.java End-----------------

              myangsunw Mingyao Yang (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: