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