Wolfram Library Archive

All Collections Articles Books Conference Proceedings
Courseware Demos MathSource Technical Notes
Title Downloads

Creating Java Palettes

Wolfram Research, Inc.
Organization: Wolfram Research, Inc.
Address: 100 Trade Center Dr.
Champaign, IL 61820
Phone: (217) 398-0700
Fax: (217) 398-0747
Email: infocenter@wolfram.com
URL: http://www.wolfram.com

One of the goals of J/Link is to allow Java user interface elements to be as close as possible to first-class members of the notebook front end environment. One way this is accomplished is with the ShareKernel function, which allows Java windows to share the kernel's attention with notebook windows. We refer to such Java windows as modeless, not in the traditional sense of allowing other Java windows to remain active, but modeless with respect to the kernel, meaning that the kernel is not kept busy until they are dismissed.

Beyond the ability to have Java windows share the kernel with the front end, it would be nice to allow actions in Java to cause effects in notebook windows, such as printing something, displaying a graph, or any of the notebook-manipulation commands like NotebookApply, NotebookPrint, SelectionEvaluate, SelectionMove, and so on. A good example of this is palette buttons. A palette button can, for example, cause the current selection to be replaced by something else and the resulting expression to be evaluated in place.

The ShareFrontEnd function lets actions in Java modeless windows trigger events in a notebook window just like palette buttons or Mathematica code you evaluate manually in a notebook.

*Wolfram Technology > Front End > Palettes and Dialog Boxes
*Wolfram Technology > Linking Technology > J/Link

Downloads Download Wolfram CDF Player

Palette.nb (58.6 KB) - Mathematica Notebook