I can't seem to find any library that you can import into Java to allow window switching on Linux.
What you can do is create a shell script to do the work for you and just call that shell script from your java application. The user needs "wmctrl" installed though.
http://askubuntu.com/questions/21262/shell-command-to-bring-a-program-window-in-front-of-another[
^]
If your application needs to run on both Windows and Linux you can run a check to see what OS the application is running in.
System.getProperty("os.name")
As for the shell scrip, you can try something like this. I haven't tested it yet as I don't have access to a Linux system. Also codeproject does not support shell scrip code so I hope this code will be readable.
#!/bin/bash
parameter1 = $1
wmctrl -a parameter1
In your Java application you can call this script like this:
Process focusGedit = new ProcessBuilder( "path/to/script", "gedit").start();