Dae galera!! Tava dando uma testada na biblioteca JDIC (JDesktop Integration Components) (https://jdic.dev.java.net/), e achei um
exemplo na net, baixei e adicionei esse jar no eclipse jdic.jar, só que quando eu rodo esse exemplo, dá as seguintes mensagens:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no tray in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.DisplayThread.<clinit>(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.WinSystemTrayService.<clinit>(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.ServiceManagerStub.getService(Unknown Source)
at org.jdesktop.jdic.tray.internal.ServiceManager.getService(Unknown Source)
at org.jdesktop.jdic.tray.SystemTray.<clinit>(Unknown Source)
at tray.TryTeste.<init>(TryTeste.java:38)
at tray.TryTeste.main(TryTeste.java:43)
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: removeIcon
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService.removeIcon(Native Method)
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService.removeAllIcons(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService$1.run(Unknown Source)
public class TrayTeste {
public static JMenuItem quit;
public TrayTeste() {
JPopupMenu menu = new JPopupMenu("Tray Icon Menu");
menu.add(new JMenuItem("Test Item"));
menu.addSeparator();
JMenuItem quitItem = new JMenuItem("Quit");
quitItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
System.exit(0);
}});
menu.add(quitItem);
// O arquivo “devmedia.gif” deve existir no mesmo diretório
// onde estiver esta classe.
ImageIcon icon = new ImageIcon("eletric.gif");
TrayIcon ti = new TrayIcon(icon, "JDIC Tray Icon API Test", menu);
// Ação para clique com botão esquerdo.
ti.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null,
"JDIC Tray Icon API Test!", "About",
JOptionPane.INFORMATION_MESSAGE);
}
});
SystemTray tray = SystemTray.getDefaultSystemTray();
tray.addTrayIcon(ti);
}
public static void main(String[] args) {
new TrayTeste();
}
Estou com um problema com o Windows 7 64 bits. Está sendo gerado o seguinte erro:
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Sistemas\Java\Projetos\Projetos NetBeans\FTP\tray.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at org.jdesktop.jdic.tray.internal.impl.DisplayThread.<clinit>(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.WinSystemTrayService.<clinit>(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.ServiceManagerStub.getService(Unknown Source)
at org.jdesktop.jdic.tray.internal.ServiceManager.getService(Unknown Source)
at org.jdesktop.jdic.tray.SystemTray.<clinit>(Unknown Source)
at br.com.jdsistemas.ftp.IconeTray.exibir(IconeTray.java:81)
at br.com.jdsistemas.ftp.FTP.main(FTP.java:34)
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: org.jdesktop.jdic.tray.internal.impl.WinTrayIconService.removeIcon(I)V
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService.removeIcon(Native Method)
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService.removeAllIcons(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService$1.run(Unknown Source)
Java Result: 1
ei, posta o codigo ai com um exemplo que eu quero usar esse troço ai tb!
Como e que isso funciona? so com o awt?? Tem como mandar um exemplo pequeninho ai? Foi mal por ja ir pedindo assim, mas acho que isso deve ser facinho de fazer e como tu ja fez, custa nada, ne?