JDK-6491631 : SystemTray not functioning on KDE 3.5
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2006-11-09
  • Updated: 2011-02-16
  • Resolved: 2006-11-09
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0-beta2"

ADDITIONAL OS VERSION INFORMATION :
Linux 2.6.17.10, KDE 3.5.5

A DESCRIPTION OF THE PROBLEM :
When SystemTray class is used to create icons on KDE 3.5.5, a blank spot is created on the system tray but the icon is not displayed.

The functionality works properly on MS Windows and KDE 3.4.x.

I'm using Kubuntu 6.10.  The problem was present on Kubuntu 6.06 too.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the code given with an icon file "icon.png" in the current directory.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The icon should be displayed on the system tray.
ACTUAL -
Blank spot on the system tray without the icon.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error displayed.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;

public class TrayDemo {
	public static void main(String [] args) throws AWTException {
		boolean available = SystemTray.isSupported();
		System.out.println(available);
		if(!available)
			return;
		Image img = Toolkit.getDefaultToolkit().getImage("icon.png");
		SystemTray tray = SystemTray.getSystemTray();
		Dimension size = tray.getTrayIconSize();
		img = img.getScaledInstance(size.width, size.height, Image.SCALE_SMOOTH);
		TrayIcon icon = new TrayIcon(img);
		tray.add(icon);
	}
}
---------- END SOURCE ----------