|MATLAB Function Reference|
Determine if a Java feature is supported in MATLAB
returns 1 if the specified feature is supported and 0 otherwise. Possible
feature arguments are shown in the following table.
||Abstract Window Toolkit components1 are available
||The MATLAB interactive desktop is running
||The Java Virtual Machine is running
||Swing components2 are available
1. Java's GUI components in the Abstract Window Tookit
2. Java's lightweight GUI components in the Java Foundation Classes
The following conditional code ensures that the AWT's GUI components are available before the M-file attempts to display a Java Frame.
The next example is part of an M-file that includes Java code. It fails gracefully when run in a MATLAB session that does not have access to a JVM.