Any suggestions from Classpath hackers?
Andrew.
--- Begin Message ---
- Subject: can get mouse events with javac but not gcj ... what's wrong?
- From: Bearish <upperbear@xxxxxxx>
- Date: Mon, 07 Jun 2010 14:47:05 -0400
- Delivered-to: mailing list java@xxxxxxxxxxx
- Mailing-list: contact java-help@xxxxxxxxxxx; run by ezmlm
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
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 ---