Java Runtime System Properties
The Java runtime system properties described here are supported in J2SE 5.0 and Java SE 6. The properties are grouped according to their functionality. Note that these properties may not all be supported in future versions of Java for OS X.
Most runtime properties accept a Boolean value. If a property accepts a different value, this is noted. It is recommended that you include these property settings in your bundled Java application’s Info.plist file. For more information on Info.plist files for Java applications, read Java Info.plist Key Reference for Mac. You can also set system properties from the command line (with the -D flag) or in your code (with the System.setProperty method). For example, you could set your Swing application to use the OS X menu bar with either
java -Dapple.laf.useScreenMenuBar="true" com.example.yourApp |
or
System.setProperty("apple.laf.useScreenMenuBar", "true"); |
When setting a property within your application (using System.setProperty), make sure that it is one of the first statements made inside of your main method. Doing so sets the property before AWT is loaded, ensuring that it takes effect.
Integration with the Native Application Environment
When using the Aqua look and feel, this property puts Swing menus in the OS X menu bar. Note that JMenuBars in JDialogs are not moved to the OS X menu bar.
The default value is
false.Allows you to display your main windows with the unified Aqua window appearance. This property should be applied only to the primary application window, and should not affect supporting windows like dialogs or preference windows.
The default value is
false.By default, the AWT File Dialog lets you choose a file. Under certain circumstances, however, it may be proper for you to choose a directory instead. If that is the case, set this property to allow for directory selection in a file dialog.
The default value is
false.Suppresses the normal application Dock icon and menu bar from appearing. Only appropriate for background applications which show a tray icon or other alternate user interface for accessing the apps windows. Unlike
java.awt.headless=true, this does not suppress windows and dialogs from actually appearing on screen.The default value is
false.
apple.laf.useScreenMenuBarapple.awt.brushMetalLookapple.awt.fileDialogForDirectoriesapple.awt.UIElementFull-Screen Java
Causes full-screen applications to be displayed in a window. You might want to use this property during development of full-screen Java applications.
This is strictly a developer option.
The default value is
false.When you have multiple displays, entering full-screen mode normally darkens the secondary screens. Setting this property to
falseoverrides the default behavior and secondary screens are not darkened. You might want to override the default behavior for development purposes like debugging.This is strictly a developer option.
The default value is
true.Hides the mouse cursor when in full-screen mode.
The default value is
true.If you change the screen resolution when entering full-screen mode, the screen transitions by fading out of the old resolution and back in with the new resolution. If you do not change screen resolution, you normally do not see this fade effect. This property enables that fade effect regardless of whether you have changed the screen resolution.
The default value is
false.
apple.awt.fakefullscreenapple.awt.fullscreencapturealldisplaysapple.awt.fullscreenhidecursorapple.awt.fullscreenusefadeQuartz Rendering Hints
Causes graphic primitives such as line, arc, rectangle, and so on, to be painted with antialiasing. Even with this property set to
onfrom the command line, you may still set theKEY_ANTIALISINGrendering hint for specific objects.This option accepts either
onorofffor its value. This property is automatically set toonwhen you use the Aqua look and feel. This makes the behavior more consistent with the native OS X user interface. Note that even if you set this toofffor an application that uses the Aqua look and feel, Aqua user interface elements themselves are still drawn with antialiasing.Causes text to be drawn with antialiasing. Sets the
KEY_TEXT_ANTIALIASINGrendering hint. Although this property inherits the same setting asapple.awt.antialiasing, you can override that setting explicitly.This option accepts either
onorofffor its value. The default value isoffunless you are using the Aqua look and feel.Determines whether Graphics2D objects prioritize speed or quality. This option accepts either
speedorqualityfor its value. It sets theKEY_RENDERINGhint so that it accepts eitherVALUE_RENDER_SPEEDorVALUE_RENDER_QUALITYas an argument.Determines which algorithm is used in image transformations, by setting the
KEY_INTERPOLATIONrendering hint. This option accepts eithernearestneighbor,bilinear, orbicubicfor its value. Setting this option passesVALUE_INTERPOLATION_NEAREST_NEIGHBOR,VALUE_INTERPOLATION_BILINEAR, orVALUE_INTERPOLATION_BICUBIC, respectively, toKEY_INTERPOLATION.Sets metrics to use floating-point values instead of using (the default) integer values, by setting the
KEY_FRACTIONALMETRICSrendering hint. Options includeonandoff, corresponding toVALUE_FRACTIONALMETRICS_ONandVALUE_FRACTIONALMETRICS_OFF, respectively.
apple.awt.antialiasingapple.awt.textantialiasingapple.awt.renderingapple.awt.interpolationapple.awt.fractionalmetricsQuartz Graphics Drawing Performance
Determines whether graphics primitives are used in place of the relatively more complex shape objects if there is an appropriate mapping. For example, a call to draw a simple shape like
draw(new Rectangle2D.Float(0, 0, 10, 10)is mapped todrawRect(0, 0, 10, 10). If you do not want this automatic optimization, set this value tofalse.The default value is
true.Determines whether graphics primitives are queued before being sent to the renderer. Doing so keeps the renderer primed and improves the graphics performance for rendering simple primitives like lines, rectangles, arcs, and ovals. This is referred to as lazy drawing. You may disable lazy drawing by setting this value to
false.The default value is
true.If lazy drawing optimization is enabled, this option sets the size of the queue used. This property takes an integer value which represents the number of graphics primitives cached. Each graphics primitive requires about 10 entries. Each entry requires 4 bytes (1 entry = 4 bytes).
The default value is
2.Determines whether hardware acceleration is used to speed up rendering of simple primitives like images, lines, rects, and simple characters. In addition to using this flag, you need to enable Quartz 2D acceleration in the Quartz Debug application, included with the Xcode Developer Tools for OS X.
This is strictly a developer option. Java applications intended for use on OS X should not rely on the presence of Quartz 2D acceleration.
The default value is
false.Determines whether drawing updates are deferred. Deferred updates eliminate visual tearing, but block those applications that flush too often. Deferred drawing updates are not supported for Java applications. If you want to enable deferred drawing throughout your application, use this system property.
This is strictly a developer option. Java applications intended for use on OS X should not rely on deferred drawing updates.
The default value is
false.Determines whether Apple’s Quartz renderer is used instead of Sun’s 2D renderer.
The default value is
truefor J2SE 5.0 andfalsefor Java SE 6.
apple.awt.graphics.OptimizeShapesapple.awt.graphics.EnableLazyDrawingapple.awt.graphics.EnableLazyDrawingQueueSizeapple.awt.graphics.EnableQ2DXapple.awt.graphics.EnableDeferredUpdatesapple.awt.graphics.UseQuartzPixel Conversion Performance
Determines whether pixel conversion is optimized for image formats that are not natively supported by the underlying operating system. Image formats that are not supported natively by Core Graphics include:
TYPE_3BYTE_BGRTYPE_4BYTE_ABGRTYPE_4BYTE_ABGR_PRETYPE_BYTE_BINARYTYPE_BYTE_INDEXEDTYPE_CUSTOMTYPE_INT_ARGBTYPE_INT_BGRTYPE_USHORT_565_RGBTYPE_USHORT_GRAY
You may override the default behavior by setting this property to
false.The default value is
true.
apple.awt.graphics.EnableLazyPixelConversion© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-08-29)