public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* can get mouse events with javac but not gcj ... what's wrong?
@ 2010-06-07 18:46 Bearish
  0 siblings, 0 replies; only message in thread
From: Bearish @ 2010-06-07 18:46 UTC (permalink / raw)
  To: java

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-07 18:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-07 18:46 can get mouse events with javac but not gcj ... what's wrong? Bearish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).