Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Try some crazy reflection bullshit
- try
- {
- // Grab the class
- Class applicationClass = Class.forName("com.apple.eawt.Application");
- // Grab the methods
- @SuppressWarnings("unchecked")
- Method getApplicationMethod = applicationClass.getMethod("getApplication");
- @SuppressWarnings("unchecked")
- Method setDockIconMethod = applicationClass.getMethod("setDockIconImage", java.awt.Image.class);
- // Call getApplication()
- Object macOSXApplication = getApplicationMethod.invoke(null); // Static
- // Call setDockIconImage()
- setDockIconMethod.invoke(macOSXApplication, iconImage);
- }
- catch(Exception e)
- {
- // If it doesn't work, don't worry about it
- }
Add Comment
Please, Sign In to add comment