Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 854888 Details for
Bug 1057556
Java AWT trayicon menu not displayed on right click
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
The java source code
Test.java (text/x-java), 1.43 KB, created by
tom.jenkinson
on 2014-01-24 10:50:11 UTC
(
hide
)
Description:
The java source code
Filename:
MIME Type:
Creator:
tom.jenkinson
Created:
2014-01-24 10:50:11 UTC
Size:
1.43 KB
patch
obsolete
>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.TrayIcon; >import java.awt.event.ActionEvent; >import java.awt.event.ActionListener; >import java.awt.image.BufferedImage; >import java.io.IOException; >import java.util.Date; > >import javax.imageio.ImageIO; >import javax.swing.ImageIcon; > >public class Test { > private static final long serialVersionUID = 1L; > > public static void main(String[] args) { > final PopupMenu popup = new PopupMenu(); > MenuItem exitMenuItem = new MenuItem("Exit"); > exitMenuItem.addActionListener(new ActionListener() { > @Override > public void actionPerformed(ActionEvent e) { > System.exit(0); > > } > }); > Menu fileMenu = new Menu("File"); > fileMenu.add(exitMenuItem); > popup.add(fileMenu); > > try { > BufferedImage connectedImg = ImageIO.read(Thread.currentThread() > .getContextClassLoader() > .getResourceAsStream("test.png")); > Image ci = new ImageIcon(connectedImg).getImage() > .getScaledInstance(24, 24, 0); > TrayIcon trayIcon = new TrayIcon(ci, "test", popup); > final SystemTray tray = SystemTray.getSystemTray(); > tray.add(trayIcon); > } catch (AWTException e) { > System.out.println(new Date() + "TrayIcon could not be added."); > e.printStackTrace(); > } catch (IOException e) { > System.out.println(new Date() + "TrayIcon could not be added."); > e.printStackTrace(); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1057556
: 854888 |
854889