Solved

Java Programming in Status Bar

Posted on 2001-06-15
15
259 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
15 Comments
 
LVL 92

Expert Comment

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

Expert Comment

by:dnoelpp
Comment Utility
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
Comment Utility
Create a 'dummy frame' and don't make'it visible.
0
 
LVL 3

Author Comment

by:shyamkumarreddy
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:dnoelpp
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Do you like my answer, or do you still need additional information?
0
 
LVL 3

Author Comment

by:shyamkumarreddy
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Still Answer not received. Time to close the question :)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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 regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now