Fwd: can get mouse events with javac but not gcj ... what's wrong?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Any suggestions from Classpath hackers?

Andrew.
--- Begin Message ---
Java code NoMouse.java is at the bottom of this posting.
NoMouse works with javac but not gcj.
You test by moving moving mouse in-and-out-of-window:
   $ javac NoMouse.java ; java NoMouse
   mouseEntered
   mouseEntered
   mouseEntered
   ...
But I do _not_ get "mouseEntered" whin compiling with gcj:
   $ gcj --main=NoMouse NoMouse.java ; ./a.out
What am I doing wrong? Is there a workaround?
How can I get mouse events when using gcj?

--- NoMouse.java follows ---

import java.awt.event.*;
import javax.swing.*;
public class NoMouse extends JFrame {
    public static void main(String [] args) { new NoMouse(); }
    public NoMouse() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(500, 300);
        addMouseListener(new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
                System.out.format("mouseEntered\n");
            }
        });
        setVisible(true);
    }
}

--- End Message ---

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux