Sat Nov 08, 2008 1:07 am
/*
* @(#)SystemTray.java 1.0 02/10/03
*
* Developed By Jeeva S
*
*/
package com.jeeva.tray;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
class SystemTray extends Frame implements ActionListener {
public SystemTray() {
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
/**********Quitting System Tray****************/
try {
process = Runtime.getRuntime().exec("data/SystemTrayKill.exe");
}catch(IOException _IoExc) { }
dispose();
System.exit(0);
}
});
setLayout(new BorderLayout());
setSize(400, 200);
setTitle("SystemTray In Java");
Label LblTray = new Label("System Tray Demo in Java !",1);
LblTray.setBackground(Color.black);
LblTray.setForeground(Color.white);
LblTray.setFont(new Font("Arial",1,25));
add("North",LblTray);
CmdTray = new Button("Go To System Tray");
CmdTray.addActionListener(this);
add("Center",CmdTray);
Label LblDevelop = new Label("Developed By Jeeva S ([email protected])",1);
LblDevelop.setBackground(Color.black);
LblDevelop.setForeground(Color.white);
LblDevelop.setFont(new Font("Arial",1,15));
add("South",LblDevelop);
/**********Loading System Tray****************/
try {
process = Runtime.getRuntime().exec("data/SystemTray.exe");
}catch(IOException _IoExc) { }
show();
}
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource().equals(CmdTray))
{
/**********Hiding Window****************/
try {
process = Runtime.getRuntime().exec("data/SystemTrayHide.exe");
}catch(IOException _IoExc) { }
}
}
public static void main(String args[]) {
SystemTray mainFrame = new SystemTray();
}
Button CmdTray;
Process process;
}
Sun Jan 20, 2013 9:40 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.