« Hybrid tutorial - Using SharedVM with JJHMain | Main | Teppefall Media Player screenshots »

Hybrid tutorial - Taskbar icon, messages and menus

About
Taskbar icon, messages and menus.

Dependencies
You must create an ext/ folder and add bsf.jar, js.jar and commons-logging.jar into this folder. Add Substance 5 (substance.jar) in the same folder for EDT checking. The application and taskbar icon is defined in the application XML file.

taskbar.js
importPackage(Packages.java.awt)
importPackage(Packages.java.awt.event)
importPackage(Packages.javax.swing)
importPackage(Packages.com.teppefall.hybrid)

context.info("I am " + context.getApplication().getApplicationName())
app = context.getApplication()

awtMenu = new MenuItem("Hello")
awtMenu.addActionListener(function(e) {
JOptionPane.showMessageDialog(app.getApplicationFrame(), "Hello taskbar !")
})
app.getTrayMenu().insertSeparator(0)
app.getTrayMenu().insert(awtMenu, 0)
app.displayTrayMessage("Added a menu item to the taskbar icon popup", JApplication.INFORMATION)

Read more about JApplication here

run.cmd
java -cp teppefall-runtime.jar com.teppefall.hybrid.app.JJHMain taskbar.xml

WindowClipping (13).png


TrackBack

TrackBack URL for this entry:
http://www.installer.teppefall.com/movabletype/mt-tb.cgi/219

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

This website is all about alpha and beta software

Download non-beta software here