PRODUCTS
Products Overview
Mathematica
Mathematica Student Edition
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
SystemModeler
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Mathematica
Documentation
Knowledge Base
Learning Center
Technical Services
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News
Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE
DOCUMENTATION CENTER
FOR THE LATEST INFORMATION.
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Java Interface
>
JLINK OVERVIEW
J/Link
User Guide
Introduction to
J/Link
J/Link
and
MathLink
Calling Java from
Mathematica
J/Link
Basics
Preamble
Loading the
J/Link
Package
Launching the Java Runtime
InstallJava
Controlling the Command Used to Launch Java
Overriding the Class Path
Loading Classes
LoadJavaClass
When to Call LoadJavaClass
Contexts and Visibility of Static Members
Inner Classes
Conversion of Types between Java and
Mathematica
Creating Objects
Calling Methods and Accessing Fields
Syntax
Underscores in Java Names
Getting Information about Classes and Objects
Quitting or Restarting Java
Version Information
Advanced Topics in
J/Link
Controlling the Class Path: How
J/Link
Finds Classes
The Java Class Path
Overriding the Startup Class Path
Dynamically Modifying the Class Path
Examining the Class Path
Using
J/Link
's Class Loader Directly
Performance Issues
Overhead of Calls to Java
Speeding Up Sending Large Arrays
An Optimization Example
Reference Counts and Memory Management
Object References in
Mathematica
ReleaseJavaObject
JavaBlock
PeekObjects and PeekClasses
Exceptions
How Exceptions Are Handled
The JavaThrow Function
Returning Objects "by Value" and "by Reference"
References and Values
ReturnAsJavaObject
JavaObjectToExpression
MakeJavaObject and MakeJavaExpr
Preamble
MakeJavaObject
MakeJavaExpr
Creating Windows and Other User Interface Elements
Preamble
Interactive and Non-Interactive Interfaces
Modal versus Modeless Operation
Handling Events with
Mathematica
Code: The "MathListener" Classes
Bringing Java Windows to the Foreground
Modal Windows
MathFrame and MathJFrame
Modeless Windows: Sharing the Kernel with Java
Sharing the Front End
Summary of Modal and Modeless Operation
"Manual" Interfaces: The ServiceJava Function
Using a GUI Builder
Drawing and Displaying
Mathematica
Images in Java Windows
The MathCanvas and MathGraphicsJPanel Classes
Showing
Mathematica
Graphics and Typeset Expressions
Drawing Using Java's Graphics Functions
Bitmaps
The Java Console Window
Using JavaBeans
Hosting Applets
Periodical Tasks
Some Special Number Classes
Preamble
The "Wrapper" Classes: Integer, Float, Boolean, and Others
Complex Numbers
BigInteger and BigDecimal
Ragged Arrays
Implementing a Java Interface with
Mathematica
Code
Writing Your Own Installable Java Classes
Preamble
Installable Functions—The Old Way
Installable Functions in Java
Setting Up Definitions in
Mathematica
When Your Class Is Loaded
Manually Returning a Result to
Mathematica
Requesting Evaluations by
Mathematica
Throwing Exceptions
Making a Method Interruptible
Writing Your Own Event Handler Code
Debugging Your Java Classes
Deploying Applications That Use
J/Link
Coding Tips
Example Programs
Introduction
A Beep Function
Formatting Dates
A Progress Bar
A Simple Modal Input Dialog
A File Chooser Dialog Box
Sharing the Front End: Palette-Type Buttons
Real-Time Algebra: A Mini-Application
GraphicsDlg: Graphics and Typeset Output in a Window
BouncingBalls: Drawing in a Window
Spirograph
A Piano Keyboard
Writing Java Programs That Use
Mathematica
Introduction
What Is
MathLink
?
Overview of the Main
J/Link
Interfaces and Classes
Preamble
MathLink
and KernelLink
MathLinkFactory
MathLinkException
Expr
PacketListener
High-Level User Interface Classes
Sample Program
Creating Links with MathLinkFactory
Using Listen and Connect Modes
Using a Remote Kernel
The
MathLink
Interface
Managing Links
Packet Functions
Error Handling
Link State
Putting
Getting
Messages
Marks
Complex Class
Yield and Message Handlers
Constants
The KernelLink Interface
Evaluate
Waiting for the Result
The "evaluateTo" Methods
Sending Java Object References
Interrupting, Aborting, and Abandoning Evaluations
Support for PacketListeners
The handlePacket() Method (Advanced Users Only)
Methods Valid Only for "StdLinks"
Sending Computations and Reading Results
MathLink
Packets
The
MathLink
"Packet Loop"
Sending an Evaluation
Reading the Result
The "evaluateTo" Methods
Using the PacketListener Interface
The PacketPrinter Class for Debugging
Using EnterTextPacket
Handling MathLinkExceptions
Graphics and Typeset Output
Preamble
MathCanvas and MathGraphicsJPanel
A Sample Program That Displays Graphics and Typeset Results
evaluateToImage() and evaluateToTypeset()
Aborting and Interrupting Computations
Using Marks
Using Loopback Links
Using Expr Objects
Motivation for the Expr Class
Methods in the
MathLink
Interface for Reading and Writing Exprs
Exprs as Replacements for Loopback Links
Exprs as a Means to Get String Representations of Expressions
Exprs as Arguments to KernelLink Methods
Examining and Manipulating Exprs
Disposing of Exprs
Threads, Blocking, and Yielding
Sending Object References to
Mathematica
Some Special User Interface Classes
Introduction
ConsoleWindow
MathSessionPane
BracketMatcher and SyntaxTokenizer
InterruptDialog
Writing Applets
TUTORIAL COLLECTION
J/Link User Guide