Link to home
Start Free TrialLog in
Avatar of shyamkumarreddy
shyamkumarreddyFlag for United States of America

asked on

Java Programming in Status Bar

Hi Guys

I have java Program which need to be running as a background. I should be able to see this program icon on the windows status bar.

And at the same time i need to same for Linux/Mac machine also.

Or do any of the guys have a code to run the java program to do such an activity.


Cheers
Shyam
Avatar of Mick Barry
Mick Barry
Flag of Australia image

But Linux and Mac don't have a Windows task bar???
Just a suggestion: Have a JFrame open, but either zero size or outside the screen?

This way you can keep an icon in the task bar but without seeing it on the desktop.

Another idea: Forget the icon in the task bar, but use RMI to export some instances in the running background program. If you start the same program again, it could check RMI whether there is running another instance already. And you could write a management GUI which talks to the background program.
Avatar of Ovi
Ovi

Create a 'dummy frame' and don't make'it visible.
Avatar of shyamkumarreddy

ASKER

Hi guys

I understand all of your idea. But i too thought abt it. I Need a better one.

Reason i don't want the user to know a process in running on his status bar. It should run be in taskbar.

I think it should be like a general task action like ur antivirus software behaves in your system
it will running behind your system but visible only at task bar not visible at the status bar


Elpp
If i am going for RMI. Still i need to open up a window right by that i am increasing the number of windows.

Cheers
Shyam


In Unix
I can run my process as java Application &
and it will run behind the task

But what happen in case of Windows
How should i do that

Am i clear now

Shyam
As for window, if you use javaw, then you don't have a console window in the task bar. This way I wrote a background program which runs totally hidden (it is visible in the task manager).

The idea with RMI is: How does the other program know that the first program is running? They use RMI (RMI is only one of the possibilities) to talk with each other...
Hi Elpp

Ur Idea is good. Does my program does behave similiar to other window application.

Javaw is okay to run as background but what happen to icon on status bar
any thing abt it.

It should be tradition windows programming using Java

Shyam
Hello Shyam

I am sorry. I don't understand everything you said. I didn't understand the "behave similar to other window application" and "tradition windows programming". Please explain a little more in detail.

As for task bar icons: If you do frame.setVisible(false) then the window disappears, and the task bar icon, too. I experimented a little bit and I could switch on the task bar icon on and off like a lamp! :-)

Another idea the other way round :-): With JWindow you have a rectangle on the screen. This rectanlge is without window borders and without an icon in the task bar. This as an idea the other way round: Something visible, but not on the task bar! :-)
Thanks Elpp

For your valuable comments.
In windows programming, i can click on the status bar to make the application visible and makes changes to my configuration.
once i minimize it. it has to go back to the statusbar.


Best example is ur Netscape Messenger i.e., your mail notifier. I hope u got it.

I am trying to do windows programming using Java.
Hope i am clear in explaining you.

Thanks for javaw, that is a good background process for windows, but for unix environ do u have something like this other than & in unix.

Cheers
Shyam

javaw is Windows specific. The problem with Windows is, that the console is treated differently than under Unix. Every Unix program can write to a console and not have problems. Just start them from an xterm and you can watch the System.out.println() pop into the xterm, and yet at the same time doing windowing work. This is not possible in Windows. I stumbled about it in programming in Delphi.

Okay, now to your problem. I think, with the status bar you mean the little icons to the right, near the clock? I am afraid, this is too platform specific. This is a Windows speciality. Java doesn't support it. I think, the best to do it, is to write a small status bar icon program natively, which, clicked on, opens a java program to talk to the background rogram. So you end up to have three programs in Windows.

1. Native program which sits on the status bar and opens program 2 when clicked on.
2. Java program which does the configuration and talks to the background program 3.
3. Background program which does work silently and maybe suddenly appears if something special happened.

Under Unix I suggest to write a small JWindow which can be placed in the lower right corner of the screen. This small icon can be clicked on and then opens the configuration window. This replaces the status bar icon rather well under Unix, I think.

If you really don't want to do something natively, just do the same trick for Windows. (JWindow in the lower right corner of the screen)
Do you like my answer, or do you still need additional information?
Hi Elpp

I always so no to additional information :) U can provide me as much as information as u can. :)

You Comments are really good. I will appreciate immediately when i get a new info from the experts.

Offcourse u know that in my comments itself.

If u can provide me more info on this. Then it is easy for me to value ur information for my small points

Your answer are really good
Keep up the good Work man


Cheers
Shyam
ASKER CERTIFIED SOLUTION
Avatar of dnoelpp
dnoelpp
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey Elpp

Just i noted a point in Linux/Unix u have a taskbar in Linux also.

I hope u know that like that in windows.
Now how should i bring it up in Linux

Cheers
Shyam
Still Answer not received. Time to close the question :)