Skip to main content

SGComponents does not respond to mouse events in JRE 1.5

3 replies [Last post]
Joined: 2004-11-03

I just played a bit around with the latest build (rev 314) and found out that SGComponents does not deliver mouse events to its components in JRE 1.5 (it does work fine in JRE 1.6).

Are you aware of this bug?

Kind regards,

import com.sun.scenario.scenegraph.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;

public class JRE15ComponentBug extends JFrame{
private JSGPanel panel = new JSGPanel();
public JRE15ComponentBug() {
super("Component Bug");

getContentPane().setLayout(new BorderLayout());
getContentPane().add(panel, BorderLayout.CENTER);

SGGroup group = new SGGroup();

SGComponent button = new SGComponent();
JButton button1 = new JButton("Test");
button1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Never invoked in JRE 1.5");
button1.addMouseMotionListener(new MouseAdapter() {
public void mouseMoved(MouseEvent e) {
System.out.println("e = " + e);


public static void main(String[] args){
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new JRE15ComponentBug();

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-05-17

I don't think that it is a bug that JavaFX doesn't work right with JDK 1.5. AFAIK, JavaFX is strictly 1.6+

Toula Michael

So no JavaFX in Applets on the Mac.

On 29 juil. 08, at 18:46, wrote:

> I don't think that it is a bug that JavaFX doesn't work right with
> JDK 1.5. AFAIK, JavaFX is strictly 1.6+
> [Message sent by forum member 'coffeejolts' (coffeejolts)]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Joined: 2004-11-03

After a bit more digging I found the bug was not in Scenegraph at all :-(

The Scenegraph project are compiled using Java 1.6, but with "-target 1.5", so everything should be able to work in 1.5.

The bug was actually in my IDE (IntelliJ), where I had setup the project using the same technique (using 1.6 javac but with target 1.5). When I launched the project, I had specified a alternative JRE (Java 1.5). But my IDE included all Java 1.6 classes, and 'confused' the scenegraph.

Sorry for false alarm :-)

Kind regards,