How to add a minimize to system tray icon button?
how can i add a minimize to system tray icon button near the others common buttons usually found on the upper right window bar? (i mean near the _ [] X)
_ for minimize to taskbar
[] for maximizing
X for closing
i'd like to add a fourth button to the left of the _ button for minimizing to system tray
like in many programs the fourth button is a dot shaped one that minimizes the program to system tray
i'd like to add one to my program as well, but i didnt find anything about this kind of buttons neither on google nor on java books
can anyone help me?
thank you!
You can't (easily). The window decorations are controled by the operating system. Your best bet is to change the functionality of the minimize-to-taskbar button and make it into a minimize-to-tray button. In fact, all the programs that minimize to the tray on my computer - about 6 of them - do it this way.
like in many programs the fourth button is a dot shaped one that minimizes the program to system trayI've never seen this?
Similar Messages
-
How to create a kde panel system tray icon set?
hi, i would like to perform a modification of oxygen style to obtain a system tray composed by icons only in grayscale or b/n tones.
i tried editing the klipper icon, by desaturating all klipper.png in the various oxygen directories, and it works fine.
but in this manner all the klipper's icons used by kde are in grayscale.
now, if i change kmix icons state, also amarok's and other icons would change?
is there any method to avoid this conflict?
byeozeta wrote:
FrozenFox wrote:To do this without affecting the icons elsewhere in the system is probably impossible without editing the source code to the sys tray plasmoid/widget and adding in a color filter of some sort. If you don't know how to program this in, you're probably out of luck. Would be interested in someone else proving me wrong though.
hi, i can't program the system tray it would be nice if there were someone that made a patch or something else. however i decolorize some icons (kmix, klipper and kmess) in a first try and this is the (not bad) result:
http://i.imagehost.org/0045/snapshot16.png
the thing is, kde HAS options for coloring icons in different places. Problem is that KDE does not use those - at least i never managed to make it work. It only worked if i set the colors globally
i tried to use this tool: only Desktop Effects works, but it changes both desktop and panel icons....but not system tray icons!!!
wow -
How to add program to windows system tray?
I heard from someone that in order to add a program to the system tray, I must use JNI. I want to ask whether there is any other alternative. If not, how do I go about doing it using JNI.
Thanx in advance.You can use the JTray API (Java System Tray API For
Windows) that can be found at http://www.JavaAPIs.com.
It supports several image types, animation, and
display of AWT and Swing Components as pop-ups. I always find it rather annoying when people scour past posts to promote a product that they have a vested interest in.
Especially when they don't point out that that they have such an interest.
Especially when they don't point out that the interest is monetary.
Especially when they do nothing but post ads - never actually answering a single question.
Just me I suppose. -
Firefox 4.0 cannot find the Yahoo mail URL. Working with the Verizon tech we were able to get Internet Explorer to finaly find the yahoo mail web site. But not luck with Firefox 4.0 .
Since trying your suggestions to make firefox 4 find the Yahoo mail URL. I have noticed that all of my system tray icons except the Panda anti virus and volume control icons have disapeared. My system restore will not restore and printers are gone altogether. How do I get the old firefox and all i've lost back.
Hector, [email protected]Still cannot fix it to get Yahoo e-mail. This what I get now from Ff3.5 now.
Sorry, we can't find "http://us.mc1121.mail.yahoo.com/mc/welcome". Please check the spelling of the web address.
From Ff4 it can't find the " URL proxy server" on it's server???
Have tried most every solutions/suggestion I could find have my computer just keeps getting worse. Where do I find the 4 solutions you mention here to see if I have not already tried them? I don't see or know where to go to find these solutions??? Can anyone help me find the fix???
E-mail add. [email protected] -
How to avoid orphaned system tray icon?
I know how to create a system tray icon for my application using InstallSysTrayIcon().
I also know how to remove it before the program terminates (calling RemoveSysTrayIcon()).
But the program closes in an expected way, or through the Task Manager, for example, the icon isn't deleted, and the user could think that the application is still running. Moreover, when you re-launch the application, a second icon is shown.
The Windows OS removes the orphaned icon when the mouse hovers over the tray.
It seems that this is an OS issue, and I did some web searches: I found this describing a way to avoid this behaviour in a C# application, but I haven't been able to port this solution to a CVI application.
Is there a way to do this with CVI 2009?
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP EmbeddedHi Luca!
Anyway if you're worried about program crashes your only option...
Actually what I'm worried about is a little bit more complicated: my CVI application could be remotely closed by other applications running on the same or other PCs on the LAN. I should avoid the icon is left on the system tray while the application has been closed, giving a wrong information to the user...
I've been using the task manager only to "simulate" a force close made by a different application.
And sure, I must increase the error handling as much as I can to avoid application crash
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP Embedded -
[Desktop] System Tray Icon: Add back Playback Controls
I just downloaded the latest version of Spotify with the minimize Spotify to the system tray. Thank you for that. You guys are getting there in fufilling my feedback request to keep the system tray icon. When Spotify minimizes to the tray, it runs in the backround and does not use up alot of CPU just like the Spotify minmize to taskbar option; however, you still need to work on putting the play, pause, next and previous controls back in the system tray icon. I'm glad the tray icon is back. It definately makes our computer perform better when we are listening to our Spotify tunes. Congratulations! Hope to see this request get put back in the Spotify system tray icon. Thank you!
I agree play/pause, next and previous are needed.In addition, option to minimize the program to tray by double-click would be very useful.
-
Dynadock V system tray icon has vanished
I have had a Dynadock V since February, 2012. Recently, the system tray icon vanished. Because it's not there, I can't undock to take my laptop somewhere else. I have to shut down the laptop and then I figure it's safe to unplug the dynadock. I've searched for help on the Toshiba website, and all I get is the statement that the icon won't be present unless the computer is connected and a monitor is attached to the dynadock. Well, the computer IS connected and I'm right now watching the monitor connected via the dynadock. But no icon that lets me undock. The users manual clearly says not to disconnect the cable without undocking, and suggests clicking the "show hidden icons button." I've done that, and the icon is not there. Does anybody know what's going on and how to fix it? Thanks in advance.
Nancy
Solved!
Go to Solution.Solution. After messing around with this for way too many hours, I've found a fix. Maybe it can help someone else.
In Windows Explorer, I found the application that puts the icon in the tray. In my case (Windows 7) it was located at C:/Program Files/TOSHIBA/Dynadock_II/TosDockApp.exe. Double clicking that put the icon in the tray, but it would be gone the next time I rebooted.
It needed to be in the Startup folder. I'm guessing that once upon a time it was there and got removed for some unknown reason. (a Windows update?) Right clicked on the application, clicked "Create Shortcut," clicked Yes to placing it on desktop. Then used the Start button, All Programs, and found Startup in the list. Right click, Open. Maneuevered the window so I could see the desktop simultaneously, and dragged the shortcut from the desktop to the list of files on the right side of the Startup window.
This solution has survived one computer restart, so I'm hoping it will last.
By the way, copying the application and pasting it in the startup folder didn't work. I had to make the shortcut.
And Toshiba, if you're listening, I'm still ticked off. Someone in Customer Support should have been able to help me with this. Or it should have been on a troubleshooting page. I've been struggling to find a solution to this problem for months. It wasn't hard -- just not obvious to someone (me) who doesn't work with this software everyday. -
System Tray Icon Not Displaying - Depending on Launch Style
Good Morning-
I'm using the java.awt.SystemTray and TrayIcon classes from 1.6 to create a system tray that acts essentially as a temperature monitor. It's very little code. When I test it from Eclipse, it works great. When I double-click the .jar on my workstation, it works great. When I launch it with java -jar temp.jar, it works great. When I launch it with javaw -jar temp.jar, I get no tray icon, but javaw sits in memory doing something.
When my users launch it with a .vbs that calls java -jar temp.jar and hides the resulting terminal window, they get no tray icon. When they call java -jar temp.jar, they get the tray icon... and the console window. When they call javaw -jar temp.jar, they get no tray icon. Any of these practices yields a java process sitting in memory.
When my users double-click the .jar file, they're asked to chose what to open it with. If they chose Java's executable, it says it doesn't know what to do (it isn't called with -jar). Windows doesn't see their jar files as executables like on mine.
So I have two issues. The result is the system tray icon won't display on users' computers without a window to accompany it. Any idea why? Is it potentially a bug?
Some code:
public class SysTrayController {
// The actual icon that will be updated
private TrayIcon icon;
// The last-set temperature
private int temp;
// The box that may or may not appear
private AlertBox box;
// No Data received (yet?)
public final static int NO_DATA = 0;
// High temperature threshold. TODO: Make this user-configurable.
private final static int HIGH_TEMP = 80;
// ... you guess
private final static String DEFAULT_ICON = "icons/default.png";
* Initiate everything. Grab the system tray, plop the icon in it, and
* get the icon all set up and ready to go with the default image.
public SysTrayController() {
box = new AlertBox();
SystemTray tray = SystemTray.getSystemTray();
Image image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(DEFAULT_ICON));
PopupMenu popup = new PopupMenu();
MenuItem exit = new MenuItem("Exit");
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
popup.add(exit);
icon = new TrayIcon(image, "Temperature Monitor", popup);
// On double-click, display the alert box
icon.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2) {
box.setVisible(true);
try {
tray.add(icon);
} catch (AWTException e) {
System.out.println(e);
* Set the temperature.
* Call setIcon() to set the icon to the right number, update the alert
* box, and if it's time to, display the alert box.
public void setTemp(int temp) {
if (this.temp != temp) {
this.temp = temp;
setIcon(temp);
icon.setToolTip(temp + " degrees");
box.setAlertMessage("Temperature in the Server Room is at " + temp + " degrees!");
box.setIcon(icon.getImage());
if (temp > HIGH_TEMP) {
box.setVisible(true);
icon.displayMessage("Alert", "Temperature in the server room is at " + temp + " degrees!", TrayIcon.MessageType.WARNING);
} else if (temp != NO_DATA){
box.setVisible(false);
* Figure out which icon to set the tray icon to, scale it down, and
* set it.
public void setIcon(int number) {
Image image = null;
if (number == NO_DATA) {
image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(DEFAULT_ICON));
} else if (number >= 60 && number < 100 ) {
String iconString = "icons/temp";
iconString += number;
iconString += ".png";
try {
image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(iconString));
} catch (NullPointerException e) {
image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(DEFAULT_ICON));
image = image.getScaledInstance(16, 16, Image.SCALE_SMOOTH);
icon.setImage(image);
* Give back the current temperature.
public int getTemp() {
return temp;
}The main() that calls it looks like this:
public static void main(String[] args) {
SysTrayController controller = new SysTrayController();
Thermometer temp = new Thermometer(HOSTNAME);
while (true) {
controller.setTemp(temp.getTemp());
try {
if (controller.getTemp() == SysTrayController.NO_DATA) {
Thread.sleep(1000);
} else {
Thread.sleep(SLEEPTIME);
} catch (Exception e) {
System.out.println(e);
}From the code above, this line actually worked for me:
image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(iconString));Just place the image inside the source folder and change the iconString thing...
For example mine looked like this
image = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icon.gif")); -
X,Y position of your system tray icon
Hi
In my app i have a functionality by which i can minimize my desktop app to systray..On minimizing my app, an icon is created in the system tray..now is this possible for me to get the x,y position of that icon located in the system tray..i want to display notification pop up above it..with a pointer pointing the system tray icon.
ThanksJust try this...
Once you get proper character's index, use the following code,
myTxtFld.getCharBoundaries(index); // this will return a rectangle.
myTxtFld.getCharBoundaries(index).x; // ===========> will provide x coordinate and
myTxtFld.getCharBoundaries(index).y; // ===========> will provide y coordinate.
Good luck !! -
Skype: no system-tray icon with Arch (+ xfce)
When I close Skype (the one and only skype window), skype is still running in the background. When I run Zenwalk with xfce, there is a skype icon as part of the taskbar, which indicates that skype is still running in the background. This icon does not pop up in Arch and xfce.
Here in the forum rdoggsv gave a hint to run "killall skype". However I would prefer to have the system-tray icon (and the right-click to close skype). By the way: skype on debian has this icon as well (see http://bbs.archlinux.org/viewtopic.php?id=14874). How can I get this xfce notification icon in Arch, as long as Skype is running?Are you sure you have system tray enabled on your xfce panel? I don't use xfce, but skype shows up correctly in the tray using trayer... I also remember it working correctly with xfce panel tray in the past so unless the latest version of xfce is buggy it should work without problems.
-
Disabling Right Click Menus for Network Magic's System Tray Icons for Standard and Guest Accounts
OK, so I want to know how to disable the right click menus for Network Magic's system tray icons only for Vista's standard and Guest accounts? I don't want other users signed in as a Standard account or guest account having the ability to disable the system tray icons for network magic.
Hi, currently it's not possible to disable NM from being accessed by a Limited user account, but that is a good idea.
My Cisco Network Magic Configuration:
Router: D-Link WBR-2310 A1 FW:1.04, connected to Comcast High Speed Internet
Desktop, iMac: NM is on the Windows Partition, using Boot camp to access Windows, Windows 7 Pro 32-bit RTM, Broadcom Wireless N Card, McAfee Personal Firewall 2009,
Mac Partition of the iMac is using Mac OS X 10.6.1 Snow Leopard
Laptop: Windows XP Pro SP3, Intel PRO/Wireless 2200BG, McAfee Personal Firewall 2008
Please note that though I am a beta tester for Network Magic, I am not a employee of Linksys/Cisco and am volunteering my time here to help other NM users. -
AIR System Tray Icon - does it support notifications?
I want to add a system tray icon when my application loads and have balloon notifications appear when something happens, i.e. the application is minimized and a new message has been received. Does AIR support this functionality?
I want to add a system tray icon when my application loads and have balloon notifications appear when something happens, i.e. the application is minimized and a new message has been received. Does AIR support this functionality?
-
Hi there,
I have a problem with my appl. May ý ask you?
I made a jpopup for using both menu in window and in system tray icon.
I used
trayIcon.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger()) {
jpopup.setLocation(e.getX(), e.getY());
jpopup.setInvoker(jpopup);
jpopup.setVisible(true);
});showing jpopup on trayicon.
But it is not closing itself. To close it, i have to push any menuitem on it.
Normally popup must close itself if we click mouse on anywhere of screen. But mine is not closing? How can fix this?regerybets wrote:
I red but couldnt find any solution.There is no solution. To get the behavior you desire you need to use trayicon.setPopupMenu(...) . But that method only takes a java.awt.PopupMenu , not a javax.swing.JPopupMenu . The code you posted is a workaround for using a JPopupMenu on a tray icon. Consequently, the workaround has a few limitations that you wont be able to fix.
EDIT
Well I came up with a workaround for the workaround. I was wondering what to call the new class when I thought "JTrayIcon" sounds ok. Curious, I googled for the name and eventually came across this [blog entry|http://weblogs.java.net/blog/alexfromsun/archive/2008/02/jtrayicon_updat.html] which references [this class|https://swinghelper.dev.java.net/source/browse/swinghelper/src/java/org/jdesktop/swinghelper/tray/JXTrayIcon.java?view=markup] called JXTrayIcon.
Turns out this class uses the same solution I came up with. An zero-sized-focused dialog is used to detect when to close the popup menu. When the dialog looses focus (by clicking on the desktop for example), the java popup mechanism automatically closes the JPopupMenu. So instead of posting my solution (which is exactly the same) I'll simply reference you to JXTrayIcon and the blog. -
So, I am developing an application that utilizes a system tray icon.
It's all pretty standard: when you click close, it hides the window and puts a system tray icon in the system tray, when you right click the tray icon, it gives you a menu with options to restore the window or to exit, and if you double left click the icon, it restores the window.
Also, any time you restore the window, the system tray icon is removed.
All that stuff works great, its just that instead of putting the image that I want as the icon, the icon is just blank - transparent - nothing. There is a space where it should be, but the image just isn't there.
The image I'm using is a gif that measures 240 x 240 pixels, and has transparency.
When the window is hidden, the program does this:
try {
tray.add(trayIcon);
} catch (AWTException e) {
System.err.println("TrayIcon could not be added.");
}to add the icon to the tray.
Here's my initialization code. It's in a method called initSysTray, which is called once in the window's constructor.
if (SystemTray.isSupported()) {
tray = SystemTray.getSystemTray();
//image that will be used for System tray Icon
ImageIcon image = new ImageIcon("Icon2.gif");
//action listener for the exit menu option
//that is part of the tray icon's pop-up menu
//it ends the application
ActionListener exitListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Exiting...");
System.exit(0);
//action listener for the restore menu option
//that is part of the tray icon's pop-up menu
//it unhides the window and removes the tray icon
ActionListener unHideListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Unhiding");
setVisible(true);
tray.remove(trayIcon);
//Action Listener that recieves events from tray icon
//basically if someone double clicks the tray icon
//then the window is restored
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Unhiding");
setVisible(true);
tray.remove(trayIcon);
//create the pop-up menu
PopupMenu popup = new PopupMenu();
//create the exit option
MenuItem defaultItem = new MenuItem("Exit");
defaultItem.addActionListener(exitListener);
//create the restore option
MenuItem unHideItem = new MenuItem("Restore");
unHideItem.addActionListener(unHideListener);
//add the options to the menu
popup.add(unHideItem);
popup.add(defaultItem);
//create the tray icon
trayIcon = new TrayIcon(image.getImage(), "Bluetooth Remote by D Law", popup);
trayIcon.setImageAutoSize(true);
trayIcon.addActionListener(actionListener);
else{
System.out.println("System Tray not supported");
}So, any help with my dissapearing icon would be greatly appreciated.Hi, are you not suppose to catch possible exceptions thrown by the TrayIcon constructor? :
//create the tray icon
trayIcon = new TrayIcon(image.getImage(), "Bluetooth Remote by D Law", popup);Try surrounding this line of code with a try and catch block. Referring to the API
documentation, there are 4 possible exceptions that can be thrown. Errors may
be present there, and we need a way to identify it. :) -
Can't mount Time Capsule on PC (white system tray icon no longer there)
My new time capsule is working perfectly on my MacBookPro, however recently I tried to get it to work on my PC laptop. I easily got the wireless internet work on the PC, that's not a problem. I installed the airport utility on my PC and it was able to recognize it through the airport utility interface/configuring window where I could change settings, etc., just like I could on my Mac. There used to be (on my PC) this white icon in my system tray on the lower right of my screen. When I clicked on this I could type my password, as prompted, and mount to the time capsule, which I could now see in My Computer as a drive. I tested a few files by dragging them over into the drive, and it worked fine. Now, a week later the icon in the system tray has disappeared, and I can no longer see the time capsule on my PC in My Computer. I can still click on the airport utility icon in my programs and see/change settings in my time capsule from my PC, but cannot see nor access the drive from My Computer (or mount by clicking on this now missing icon). Anyone else know what I can do? Thanks in advance!
I was just having this problem and figured out that the white system tray icon is the Airport Base Station Agent. It wasn't running for me for some reason, too, but I found it and started it back up again at C:\Program Files\AirPort\APAgent.exe.
Here's an Apple Support article (it's a little old) I found that discusses drive mapping in windows with the Airport Base Station Agent: http://support.apple.com/kb/HT1331
Hope this helps.
Maybe you are looking for
-
When I open skype gives me an error message how can I solve this problem?
-
Hi all. I try to fix exchange rate in a post document ( With FB01 transaction ) filling the BKPF-KURSF field, and the system displays next message: Exchange rate of USD fixed for translation from EUR to 0,81853 The exchange rate 0,81853 is the last
-
Transaction boundaries for an Integration Knowledge Module
Hi All, We are currently using the SQL Incremental Update IKM to push changes from our source to target database. Our target database is denormalized to extract out data that can change over time into tables that are indexed on load timestamps that c
-
Why my epson 3800pro doesn't center the print
Hi, I have a interesting and very annoying problem. Why my epson 3800 doesn't center the prints on the paper anymore? Using this printer for more than two years now and all of the sudden regardless the paper size and the settings the i mages are cent
-
How to include a java-class in a JSP.
I have the following code in a jsp: <jsp:include page = "http://test1.testing.com:81/TestClass" /> I throws the following error: Servlet failed with Exception java.io.IOException: Nested 404 error If I copy paste the url (http://test1.testing.com:81/