Click here to Skip to main content
15,892,005 members
Home / Discussions / Java
   

Java

 
AnswerRe: java.security.InvalidKeyException, Can somebody Help Me!! Pin
427748010-Sep-09 11:35
427748010-Sep-09 11:35 
GeneralRe: java.security.InvalidKeyException, Can somebody Help Me!! Pin
ChiSmile10-Sep-09 19:22
ChiSmile10-Sep-09 19:22 
GeneralRe: java.security.InvalidKeyException, Can somebody Help Me!! Pin
427748010-Sep-09 20:11
427748010-Sep-09 20:11 
GeneralRe: java.security.InvalidKeyException, Can somebody Help Me!! Pin
ChiSmile11-Sep-09 0:13
ChiSmile11-Sep-09 0:13 
GeneralRe: java.security.InvalidKeyException, Can somebody Help Me!! Pin
ChiSmile11-Sep-09 20:34
ChiSmile11-Sep-09 20:34 
GeneralRe: java.security.InvalidKeyException, Can somebody Help Me!! Pin
427748011-Sep-09 20:45
427748011-Sep-09 20:45 
QuestionBeautiful tooltip for TrayIcon Pin
sharkbc9-Sep-09 22:49
sharkbc9-Sep-09 22:49 
AnswerRe: Beautiful tooltip for TrayIcon Pin
427748010-Sep-09 3:39
427748010-Sep-09 3:39 
In short if the TrayIcon class was a JComponent then you can simply apply html tags to it. Therefore, to simulate what you need I will use the jdic.jar from https://jdic.dev.java.net/servlets/ProjectDocumentList?expandFolder=4183&folderID=5497.

import javax.swing.*;
import org.jdesktop.jdic.tray.*;
import java.awt.BorderLayout;
import java.awt.event.*;

public class SystemTrayDemo extends JFrame 
{
	public TrayIcon trayIcon;
	public JDialog dialog;

	public SystemTrayDemo() 
	{

		JPopupMenu menu = new JPopupMenu("Menu");
		JMenuItem menuItem1 = new JMenuItem("Menu1");
		menu.add(menuItem1);

		JMenuItem menuItem2 = new JMenuItem("Menu2");
		menu.add(menuItem2);

		JMenuItem menuItem3 = new JMenuItem("Menu3");
		menu.add(menuItem3);

		JMenuItem menuItem4 = new JMenuItem("Exit");
		menu.add(menuItem4);

		menuItem4.addActionListener(new ActionListener() 
		{
			public void actionPerformed(ActionEvent evt) 
			{
				System.exit(0);
			}
		});

		ImageIcon icon = new ImageIcon("middle.gif");
		trayIcon = new TrayIcon(icon, "Hello System Tray", menu);

		SystemTray tray = SystemTray.getDefaultSystemTray();
		tray.addTrayIcon(trayIcon);
		trayIcon.addActionListener(new ActionListener() 
		{
			public void actionPerformed(ActionEvent e)
			{
				dialog = new JDialog();
				dialog.add(new JLabel("Title"), BorderLayout.NORTH);
				dialog.add(new JLabel("Message"), BorderLayout.CENTER);
				dialog.add(new JLabel(new ImageIcon("middle.gif")),BorderLayout.SOUTH);
				dialog.setLocation(trayIcon.getLocationOnScreen().x - 50,trayIcon.getLocationOnScreen().y - 105);
				dialog.setVisible(true);
				dialog.setSize(100, 100);
				dialog.setResizable(false);
				dialog.addMouseListener(new MouseAdapter() 
				{
					public void mouseReleased(MouseEvent e) 
					{
						dialog.dispose();
					}
				});
			}
		});
	}

	public static void main(String[] args) 
	{
		new SystemTrayDemo();
	}
}


The presentation of it is close to aero peek in windows 7.

Hope this helps.

Regards
GeneralRe: Beautiful tooltip for TrayIcon Pin
sharkbc10-Sep-09 17:07
sharkbc10-Sep-09 17:07 
GeneralRe: Beautiful tooltip for TrayIcon Pin
427748010-Sep-09 17:58
427748010-Sep-09 17:58 
GeneralRe: Beautiful tooltip for TrayIcon [modified] Pin
sharkbc10-Sep-09 18:35
sharkbc10-Sep-09 18:35 
GeneralRe: Beautiful tooltip for TrayIcon Pin
427748011-Sep-09 11:22
427748011-Sep-09 11:22 
GeneralRe: Beautiful tooltip for TrayIcon Pin
sharkbc13-Sep-09 21:52
sharkbc13-Sep-09 21:52 
Questionrdp platform independent Pin
ashishqwerty8-Sep-09 13:40
ashishqwerty8-Sep-09 13:40 
AnswerRe: rdp platform independent Pin
42774808-Sep-09 15:10
42774808-Sep-09 15:10 
Questionj2ee code for sending mail [modified] Pin
sangeeta20098-Sep-09 5:09
sangeeta20098-Sep-09 5:09 
AnswerRe: j2ee code for sending mail Pin
Nagy Vilmos8-Sep-09 10:39
professionalNagy Vilmos8-Sep-09 10:39 
AnswerRe: j2ee code for sending mail Pin
42774808-Sep-09 13:03
42774808-Sep-09 13:03 
GeneralRe: j2ee code for sending mail Pin
sangeeta200910-Sep-09 22:51
sangeeta200910-Sep-09 22:51 
GeneralRe: j2ee code for sending mail Pin
427748011-Sep-09 13:27
427748011-Sep-09 13:27 
GeneralRe: j2ee code for sending mail Pin
sangeeta200917-Sep-09 6:21
sangeeta200917-Sep-09 6:21 
GeneralRe: j2ee code for sending mail Pin
427748018-Sep-09 15:25
427748018-Sep-09 15:25 
GeneralRe: j2ee code for sending mail Pin
sangeeta200923-Sep-09 5:16
sangeeta200923-Sep-09 5:16 
GeneralRe: j2ee code for sending mail Pin
427748023-Sep-09 18:25
427748023-Sep-09 18:25 
Questionhow to convert swings to java applet Pin
Member 46403268-Sep-09 3:32
Member 46403268-Sep-09 3:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.