4

The Compiz Showmouse plugin has some nice effects for people with low vision. Unfortunately, those effects don't work in Java applications out of the box. How can I get my Java Swing application to show the mouse effects like other apps do? I'm only concerned about supporting Linux users (mainly Linux Mint and Ubuntu). The Java app uses the Nimbus L&F and it is a Netbeans single frame app (but I build all frames manually with Gridbaglayout). I need the Compiz mouse effects to be consistent everywhere and all the time in my app, as long as the Compiz effects are enabled by the system.

MountainX
  • 5,773
  • 8
  • 41
  • 75

1 Answers1

1

I've created a simple Swing frame:

import javax.swing.*;

public class A extends JFrame {

public static void main(String[] args) {
    A a = new A();
    a.setSize(100, 100);
    a.setVisible(true);
}
}

I've ran it on a JDK 1.6:

$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10) (Gentoo build 1.6.0_22-b22)
OpenJDK 64-Bit Server VM (build 20.0-b10, mixed mode)

I've enabled the Show Mouse effect, and it was running on top of the Swing window just fine.

So elaborate your question please. What exactly doesn't work and what exact configuration.

Oleg Mikheev
  • 16,026
  • 12
  • 69
  • 93
  • Today I did figure out how to get my Java Swing application to use the system cursor and the Compiz Showmouse effects. However, in my case, it takes some code. Building an app with your code doesn't do it for me on Ubuntu 10.04, 10.10, 11.04 or 11.10, nor on Linux Mint 9, 10 or 11. I'm going to post my solution tomorrow, as soon as I get time. Glad to hear things "just work" on Gentoo! :) – MountainX Nov 06 '11 at 02:57
  • @OlegMikheev That was specific to compiz? I have similar problem in Windows 7: in Swing all cursors except the default renders differently from the cursors set up in Windows, don't have shadows and look very odd. – Display Name Jun 17 '13 at 17:20