This article lists the runtime system properties supported in Java 1.4.2. Most of the properties are also supported in Java 1.4.1. The properties are grouped according to their functionality. Note that these properties may not all be supported in future versions of Java in Mac OS X.
Using Runtime Properties
Integration With the Native Application Environment
Rendering Hints
Full Screen Java
Graphics Drawing Performance
Pixel Conversion Performance
Rendering Performance
Window Positioning
Most of these properties accept a Boolean value. If they accept a different value, that is noted. You can call them from the command line with the -D flag to java or in your code with System.setProperty. For example, you could set your Swing application to use the Mac OS X menu bar with either
java -Dapple.laf.useScreenMenuBar="true" yourApplication |
or
System.setProperty("apple.laf.useScreenMenuBar", "true"); |
When using setting these properties within your application (using System.setProperty ), make sure that it's 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.
apple.laf.useScreenMenuBarIf you are using the Aqua look and feel, this property puts Swing menus in the Mac OS X menu bar. Note that JMenuBars in JDialogs are not moved to the Mac OS X menu bar.
The default value is false. Java applications created with Xcode have this property set to true.
apple.awt.brushMetalLookAllows you to display your main windows with the “textured” Aqua window appearance instead of the standard Aqua pinstripe style. This differs from apple.awt.brushMetalRounded in that windows with this property set feature squared-off corners. 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.
apple.awt.brushMetalRoundedAllows you to display your main windows with the “textured” Aqua window appearance, including rounded edges. This differs from apple.awt.brushMetalLook in that windows with this property set feature rounded corners and thicker edges. 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.
apple.awt.fileDialogForDirectoriesBy 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.
apple.awt.showGrowBoxMost native Mac OS X windows have a resize control in the bottom-right corner. By default, Java application windows that use the Aqua look and feel show this control, but there may be circumstances where you want it to be hidden. This property is used to decide if the grow box is shown or not.
The default value is true.
apple.awt.antialiasingCauses graphic primitives like line, arc, rectangle, and so on, to be painted with antialiasing. By default, text also takes this setting, though you can override it using apple.awt.textantialiasing. Even with this property set to on from the command line, you may still set the KEY_ANTIALISING rendering hint for specific objects.
This option accepts either on or off for its value. Although this property is off by default, it is set to on when you use the Aqua look and feel. This makes the behavior more consistent with the native Mac OS X user interface. Note that even if you set this to off for an application that uses the Aqua look and feel, Aqua user interface elements themselves are still drawn with antialiasing.
apple.awt.textantialiasingSets the KEY_TEXT_ANTIALIASING rendering hint. Although this property inherits the same setting as apple.awt.antialiasing, you can override that setting explicitly.
This option accepts either on or off for its value. The default value is off unless you are using the Aqua look and feel.
apple.awt.renderingDetermines whether Graphics2D objects prioritize speed or quality. This option accepts either speed or quality for its value. It sets the KEY_RENDERING hint so that it accepts either VALUE_RENDER_SPEED or VALUE_RENDER_QUALITY as an argument.
apple.awt.interpolationSets the KEY_INTERPOLATION rendering hint to determine which algorithm is used in image transformations. This option accepts either nearestneighbor, bilinear, or bicubic for its value. Setting this option passes VALUE_INTERPOLATION_NEAREST_NEIGHBOR, VALUE_INTERPOLATION_BILINEAR, or VALUE_INTERPOLATION_BICUBIC, respectively, to KEY_INTERPOLATION.
apple.awt.fractionalmetricsSets the KEY_FRACTIONALMETRICS to use floating point font metrics instead of the default integer metrics. Options include on and off to set VALUE_FRACTIONALMETRICS_ON or VALUE_FRACTIONALMETRICS_OFF.
apple.awt.fakefullscreenCauses 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.
apple.awt.fullscreencapturealldisplaysWhen you have multiple displays, entering full-screen mode normally darkens the secondary screens. Setting this property to false overrides 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.
apple.awt.fullscreenhidecursorHides the mouse cursor when in full-screen mode.
The default value is true.
apple.awt.fullscreenusefadeIf 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.graphics.OptimizeShapesBy default, Java in Mac OS X tries to use graphics primitives in place of the relatively more complex shape objects if there is an appropriate mapping. For example, a call to draw a simple shapes like draw(new Rectangle2D.Float(0, 0, 10, 10) is mapped to drawRect(0, 0, 10, 10). If you do not want this automatic optimization, set this value to false.
The default value is true.
apple.awt.graphics.EnableLazyDrawingBy default, drawing actions for graphics primitives are queued before being sent to the renderer. This 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.
apple.awt.graphics.EnableLazyDrawingQueueSizeIf 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.
apple.awt.graphics.EnableQ2DXQuartz 2D acceleration is a feature included in Mac OS X v.10.4 for development purposes. It uses hardware acceleration 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 Mac OS X v.10.4.
This is strictly a developer option. Java applications intended for use on Mac OS X v.10.4 should not rely on the presence of Quartz 2D acceleration.
The default value is false.
apple.awt.graphics.EnableDeferredUpdatesMac OS X v.10.4 uses deferred drawing updates, which eliminates visual tearing, but blocks 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 Mac OS X v.10.4 should not rely on deferred drawing updates.
The default value is false.
apple.awt.graphics.UseQuartzJ2SE 5.0 Release 4 features support for Sun's 2D renderer. To use the Sun 2D renderer, set this property to false.
This is strictly a developer option. Java applications intended for use on Mac OS X should not rely on Sun's 2D renderer.
The default value is true.
apple.awt.graphics.EnableLazyPixelConversionBy default, the Java implementation in Mac OS X optimizes pixel conversion 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_BGR
TYPE_4BYTE_ABGR
TYPE_4BYTE_ABGR_PRE
TYPE_BYTE_BINARY
TYPE_BYTE_INDEXED
TYPE_CUSTOM
TYPE_INT_ARGB
TYPE_INT_BGR
TYPE_USHORT_565_RGB
TYPE_USHORT_GRAY
You may override the default behavior by setting this property to false.
The default value is true.
The following properties all allow you to turn off specific aspects of rendering. These are useful if you are debugging performance issues and need to pinpoint where a particular performance issue is occurring in your code. The default setting for all of them is true, where the indicated item is rendered. Setting any of these properties to false will cause that particular item not to be rendered.
For example, if you notice a significant slowdown in your program and suspect that it might be occurring when you the renderer is filling rectangles, you could pass in apple.awt.graphics.RenderFillRect=false and note whether that significantly speeds up the performance of your code.
apple.awt.graphics.RenderLineDetermines whether lines are rendered.
The default value is true.
apple.awt.graphics.RenderDrawRectDetermines whether rectangles are drawn by the renderer.
The default value is true.
apple.awt.graphics.RenderFillRectDetermines whether rectangles are filled by the renderer.
The default value is true.
apple.awt.graphics.RenderDrawRoundRectDetermines whether round rectangles are drawn by the renderer.
The default value is true.
apple.awt.graphics.RenderFillRoundRectDetermines whether round rectangles are filled by the renderer.
The default value is true.
apple.awt.graphics.RenderDrawOvalDetermines whether ovals are drawn by the renderer.
The default value is true.
apple.awt.graphics.RenderFillOvalDetermines whether ovals are filled by the renderer.
The default value is true.
apple.awt.graphics.RenderDrawArcDetermines whether arcs are drawn by the renderer.
The default value is true.
apple.awt.graphics.RenderFillArcDetermines whether arcs are filled by the renderer.
The default value is true.
apple.awt.graphics.RenderDrawPolygonDetermines whether polygons are drawn by the renderer.
The default value is true.
apple.awt.graphics.RenderFillPolygonDetermines whether polygons are filled by the renderer.
The default value is true.
apple.awt.graphics.RenderDrawShapeDetermines whether shapes are drawn by the renderer.
The default value is true.
apple.awt.graphics.RenderFillShapeDetermines whether shapes are filled by the renderer.
The default value is true.
apple.awt.graphics.RenderImageDetermines whether any images are drawn by the renderer.
The default value is true.
apple.awt.graphics.RenderStringDetermines whether strings are rendered.
The default value is true.
apple.awt.graphics.RenderGlyphsDetermines whether glyphs are rendered.
The default value is true.
apple.awt.graphics.RenderUnicodesDetermines whether Unicode text is rendered.
The default value is true.
apple.awt.window.position.forceSafeCreationEnforces the creation of new windows on screen. New windows are not created offscreen where users would not be able to access them.
The default value is false.
apple.awt.window.position.forceSafeProgrammaticPositioningProhibits windows from being moved programatically into a position where users are unable to access them. The true setting promotes optimal interaction between the Java environment and the native window server. Setting this property to false may result in unpredictable behavior in the windowing environment.
The default value is false.
apple.awt.window.position.forceSafeUserPositioningProhibits users from moving windows into a position where they would no longer be able to access them.
The default value is false.
Last updated: 2006-05-23