|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

04-24-2008, 01:02 PM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 38
|
|
|
JAVA application residing on the windows tool bar!
I want my java application to reside on the tools bar like the windows messenger and so on.Can i do this without a third party tool?or what would be the best tool for this?Any idea?
|
|

04-24-2008, 01:09 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
You mean adding a tray icon? Or scrolling windows like messenger?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-24-2008, 02:11 PM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 38
|
|
|
Yes u r right.Can u help me?Can u provide some sample codes?
|
|

04-24-2008, 02:33 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Try this,
import java.awt.AWTException;
import java.awt.Image;
import java.awt.Menu;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
*
* @author Eranga Tennakoon
*/
public class rameshraj {
TrayIcon trayIcon;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
new rameshraj().trayIconTest();
}
private void trayIconTest() {
if (SystemTray.isSupported()) {
try {
SystemTray tray = SystemTray.getSystemTray();
ActionListener exitListener = new ActionListener(){
public void actionPerformed(ActionEvent e){
System.exit(0);
}
};
PopupMenu popup = new PopupMenu();
MenuItem _one = new MenuItem("Exit");
Menu _two = new Menu("Item_Two");
_one.addActionListener(exitListener);
popup.add(_one);
popup.add(_two);
Image image = Toolkit.getDefaultToolkit().getImage("RADAR.png");
trayIcon = new TrayIcon(image, "Java", popup);
trayIcon.setImageAutoSize(true);
tray.add(trayIcon);
}
catch (AWTException e)
{
System.err.println("TrayIcon could not be added.");
}
}
else {
System.err.println("SystemTray is not supported.");
}
}
}
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-25-2008, 12:00 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Canada
Posts: 191
|
|
It is funny  if you want to see almost the SAME way of doing it look here:
More desktop integration: the system tray | Little Tutorials
__________________
Daniel @ [ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. ]
Language is froth on the surface of thought
|
|

04-25-2008, 11:21 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 38
|
|
|
Thank s for all of you.Actually I got good idea about the tray icon.But now can I be sure that after the OS starts the application resides in the toolbar as the tray icon or I need to run it manually every time the computer starts?
|
|

04-25-2008, 11:53 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Implement your application in startup folder.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-25-2008, 01:54 PM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 38
|
|
|
For instance i have the application as a jar file: test.jar.
Now where to put the jar file?There are many startup folders one for each application that are installed on the machine.
Can u clarify me where to put the jar file and more about the startup folder?
|
|

04-25-2008, 06:28 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Canada
Posts: 191
|
|
If you put it in the startup folder (there is one startup folder per user) the application will only run when somebody logs into the machine. Your solution is to run your application as a Windows Service as I said before in another thread. Unless you run on Windows 95 and you can use the RunServices Registry key. 
__________________
Daniel @ [ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. ]
Language is froth on the surface of thought
|
|

04-28-2008, 06:18 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Yes, as daniel says if you have many users on a single PC, need to include in each startup folder. It's not easy at all. So best thing is use a Windows Service.
Why I talking about the startup folder is, if you can build a executable file easily you can define the place where you want to install the application.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-28-2008, 08:45 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 38
|
|
|
but how can this be done can u explain with some examples?
|
|

04-28-2008, 09:03 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Originally Posted by rameshraj
but how can this be done
Windows service? or Executable file?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-28-2008, 11:36 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 38
|
|
|
how to add the jar or exe to the windows service without using any third party tool?I have been asking so far but only rounded answers are coming,can we come to the point?
|
|

04-28-2008, 11:53 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
No need to add the jar/exe to the service. What you can do is, execute a process on it.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-28-2008, 04:29 PM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 38
|
|
|
can u show how?Ex how to start the application as service?
|
|

04-29-2008, 05:24 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Did you Google it. You can find a lot about that on the web.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-29-2008, 09:14 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Canada
Posts: 191
|
|
|
The point is that you have to use a third party tool or to write a service yourself. To write a service yourself it is not easy if you don't know C/C++ and Windows programming.
__________________
Daniel @ [ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. ]
Language is froth on the surface of thought
|
|

04-29-2008, 10:02 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
And also you can use .Net as well. Most popular way to write windows services. Isn't it Daniel?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-29-2008, 04:12 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Canada
Posts: 191
|
|
It might very well be Eranga  but I stopped being a Windows programmer before .NET was out on the market so I never had the pleasure 
__________________
Daniel @ [ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. ]
Language is froth on the surface of thought
|
|

04-30-2008, 05:30 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Ah, even me too, initially dealing with C++ and later move to .Net. Seems not bad actually, much easy to work with.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips:
| | |