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

Bearish upperbear@gto.net
Mon Jun 7 18:46:00 GMT 2010


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);
 }
}


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /