minimise to systray

I am new to all of this Java stuff and would like some help with an applet that I am trying to minimize to the systray. If this is possible?

why I am using an applet? I need a small app to launch from my database system that has a php front end, basically I have a php mysql database program that records an employees work time. What I need is, after closing the parent system a small app that launchs and runs in the system tray. This app/applet is launched from the php page displays a message then is minimized to the system tray.

so far I have an applet with a JFrame and Jpanel I have a windowlistener that will display a joptionPane but will NOT invoke my TrayIcon class below is the code that I am using.

frame.addWindowListener( new WindowAdapter() {
// This window listener responds when the user
// clicks the window's close box by giving the
// user a chance to change his mind.
public void windowClosing(WindowEvent evt) {

stephen oconnor wrote:I am new to all of this Java stuff and would like some help with an applet that I am trying to minimize to the systray. If this is possible?

I very much doubt it. On most operating systems the "systray" can only contain applications which are running as a process. An applet isn't such a thing.

why I am using an applet? I need a small app to launch from my database system that has a php front end, basically I have a php mysql database program that records an employees work time. What I need is, after closing the parent system a small app that launchs and runs in the system tray. This app/applet is launched from the php page displays a message then is minimized to the system tray.

Then why aren't you using Java Web Start? That's the standard way to launch a Java application from a web site.

Stephen O'Connor
Greenhorn

Joined: Oct 19, 2010
Posts: 11

posted Oct 19, 2010 11:33:11

0

hello Paul,

thanks for yr response and yr advice. so an applet is not a process but a JFrame is? I got some code that runs a JFrame from command prompt, the code is a basic JFrame that minimizes to "systray".

Can I display a frame or dialog using an applet and the frame contains a button that when the user clicks the button the frame is minimised to the "sysTray"? its just I have been tring to learn about applets and now I have to learn java web atart. I hope it wasn't a total waste of time..

stephen oconnor wrote:Can I display a frame or dialog using an applet and the frame contains a button that when the user clicks the button the frame is minimised to the "sysTray"? its just I have been tring to learn about applets and now I have to learn java web atart. I hope it wasn't a total waste of time..

No, a JFrame popped up from an applet is still part of the applet, which is still part of the browser. It's all one process.

will take a look at javaws its always fun to learn something new.

The programming for applets and applications is basically the same, especially if the application is going to be distributed by JWS. The main problem with applets (and with Web Start) is getting the configuration right. However in neither case is it horrendously difficult to do that.

Stephen O'Connor
Greenhorn

Joined: Oct 19, 2010
Posts: 11

posted Oct 20, 2010 12:30:24

0

Paul,

Thanks a million for taking the time to answer my questions. No wonder I was having so much trouble trying to get that applet to work. I see what you mean by the same process, makes sense alright.

Maybe not horrendously difficult, just difficult for me anyway... what do you mean by getting the configuration right?

Have you any suggestions on where to start? so far I took a look at wiki and the sun tutorials do you know of any good site to learn about JWS with good examples?