Set Java Properties
Set Java System Properties
Set Java® system properties in one of two ways:
In the
Javastatement. Use the syntax:java -D, wherepropertyname=valueis the name of the Java system property you want to set andpropertynameis the value to which you want the property set.valueIn the Java code. Insert the following statement in your Java code near the top of the
mainfunction, before you initialize any Java classes:System.setProperty(key,value)is the name of the Java system property you want to set, andkeyis the value to which you want the property set.value
Ensure a Consistent GUI Appearance
After developing your initial GUI using the MATLAB®
Compiler SDK™ product, subsequent GUIs that you develop may inherit properties of the
MATLAB GUI, rather than properties of your initial design. To preserve your
original look and feel, set the mathworks.DisableSetLookAndFeel
Java system property to true.
Setting DisableSetLookAndFeel
The following are examples of how to set
mathworks.DisableSetLookAndFeel using the techniques in Set Java System Properties:
In the
javastatement:java -classpath X:/mypath/tomy/javabuilder.jar -Dmathworks.DisableSetLookAndFeel=trueIn the Java code:
Class A { main () { System.getProperties().set("mathworks.DisableSetLookAndFeel","true"); foo f = newFoo(); } }