Solved

Java Programming in Status Bar

Posted on 2001-06-15
15
270 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:shyamkumarreddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
15 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6194537
But Linux and Mac don't have a Windows task bar???
0
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6194559
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.
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6194957
Create a 'dummy frame' and don't make'it visible.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:shyamkumarreddy
ID: 6194985
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


0
 
LVL 3

Author Comment

by:shyamkumarreddy
ID: 6194990
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
0
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6195009
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...
0
 
LVL 3

Author Comment

by:shyamkumarreddy
ID: 6195062
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
0
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6195098
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! :-)
0
 
LVL 3

Author Comment

by:shyamkumarreddy
ID: 6195156
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

0
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6195238
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)
0
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6206112
Do you like my answer, or do you still need additional information?
0
 
LVL 3

Author Comment

by:shyamkumarreddy
ID: 6206135
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
0
 
LVL 3

Accepted Solution

by:
dnoelpp earned 100 total points
ID: 6209194
Thanks. It's up to you whether do you want to close the question or still wait for additional comments from other experts. I just wanted to remind you that you still have this question open.

I don't have any more comments to this question as for now.
0
 
LVL 3

Author Comment

by:shyamkumarreddy
ID: 6209203
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
0
 
LVL 3

Author Comment

by:shyamkumarreddy
ID: 6912531
Still Answer not received. Time to close the question :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question