The Source for Java Technology Collaboration


Home | Changes | Index | Search | Go

List of undocumented properties to change the behavior of Swing in Suns JVM.

These properties can be passed to any application using the -D flag on the java executable. These flags have not been defined by any JCP and have not been documented in any standards document by the Sun Swing team, so don't expect these flags to work on all versions or all platforms.

Flag type Default As of Version Platform Description
swing.boldMetal boolean ? ? All Documented in MetalLookAndFeel?, whether metal should use bold fonts.
swing.defaultlaf classname ? ? All If a developer doesn't explicitly specify a look and feel, this will be used.
swing.useSystemFontSettings boolean true ? Windows whether or not the system font sizes should be used. This can also be used for Swing's windows look and feel to turn off getting the fonts from the desktop.
sun.java2d.noddraw boolean ? ? Windows turn off directX directdraw for faulty installations
swing.aatext boolean ? 1.5/5.0 All make all widgets use anti-aliasing
java.awt.headless boolean ? ? All Allow the JVM to instantiate things like Color and other awt-objects without a display to show it on
sun.awt.noerasebackground boolean false ? All Do not erase the backgound during moving windows "gray fog"
sun.swing.enableImprovedDragGesture boolean false update 5 of J2SE? 5.0 All http://weblogs.java.net/blog/shan_man/archive/2005/06/improved_drag_g.html
sun.awt.keepWorkingSetOnMinimize boolean false 1.5/5.0 Windows Keep awt working set in memory
java.awt.fonts String ? ? All(?) Set location of fonts?
java.awt.graphicsenv classname ? ? All(?) Name of graphics environment class?
sun.awt.exception.handler classname ? ? All(?) Class that handles uncaught exceptions (but not thread death)
awt.toolkit classname ? ? All(?) Default Toolkit class ?
javax.swing.adjustPopupLocationToFit boolean ? ? All(?) ? See bug 4725596
swing.noxp boolean ? ? All(?) On Windows XP platform, swing looks like Windows 2000 instead.
awt.image.incrementaldraw String ? ? All(?) ?
awt.image.redrawrate String ? ? All(?) ?
awt.nativeDoubleBuffering String ? ? All(?) When turned off, blinking is a revalidate(), and a quick flicker is a repaint()
awt.threadgroup String ? ? All(?) ?
i18n String ? ? All(?) ?
java.awt.Window.locationByPlatform String ? ? All(?) ?
java.awt.im.style String ? ? All(?) ?
java.awt.syncLWRequests String ? ? All(?) ?
java2d.font.usePlatformFont String ? ? All(?) ?
javax.accessibility.assistive_technologies String ? ? All(?) ?
javax.accessibility.screen_magnifier_present String ? ? All(?) ?
javax.swing.adjustPopupLocationToFit String ? ? All(?) ?
sun.awt.erasebackgroundonresize String ? ? All(?) ?
sun.awt.fontconfig String ? ? All(?) ?
sun.awt.nopixfmt String ? ? All(?) ?
sun.java2d.accelReset String ? ? All(?) ?
sun.java2d.accthreshold String ? ? All(?) ?
sun.java2d.allowrastersteal String ? ? All(?) ?
sun.java2d.checkRegistry String ? ? All(?) ?
sun.java2d.d3d String ? ? All(?) Direct 3D
sun.java2d.d3dtexbpp String ? ? All(?) ?
sun.java2d.ddblit String ? ? All(?) ?
sun.java2d.ddforcevram String ? ? All(?) ?
sun.java2d.ddlock String ? ? All(?) ?
sun.java2d.ddoffscreen String ? ? All(?) ?
sun.java2d.ddscale String ? ? All(?) ?
sun.java2d.debugfonts String ? ? All(?) ?
sun.java2d.disableRegistry String ? ? All(?) ?
sun.java2d.font.minstrikes String ? ? All(?) ?
sun.java2d.fontpath String ? ? All(?) ?
sun.java2d.gdiBlit String ? ? All(?) ?
sun.java2d.managedimages String ? ? All(?) ?
sun.java2d.noType1Font String ? ? All(?) ?
sun.java2d.offscreenSharing String ? ? All(?) ?
sun.java2d.opengl String ? ? All(?) Turns on/off OpenGL?? acceleration/support ?
sun.java2d.reftype String ? ? All(?) ?
sun.java2d.trace String ? ? All(?) ?
sun.java2d.translaccel String ? ? All(?) Turns on/off translucency Acceleration ?
suppressSwingDropSupport String ? ? All(?) Turn off Drag n Drop in Swing (only AWT DnD?)
swing.auxiliarylaf String ? ? All(?) ?
swing.crossplatformlaf String ? ? All(?) ?
swing.disablenavaids String ? ? All(?) Navigation Helpers
swing.plaf.metal.controlFont String ? ? All(?) ?
swing.plaf.metal.smallFont String ? ? All(?) ?
swing.plaf.metal.systemFont String ? ? All(?) ?
swing.plaf.multiplexinglaf String ? ? All(?) ?
swing.useSystemFontSettings String ? ? All(?) ?
swing.volatileImageBufferEnabled String ? ? All(?) ?
swing.disableFileChooserSpeedFix boolean ? ? All(?) Something related to using JFileChooser? ?

The following properties are Swing component client properties, which are usually introduced to provide new features without changing the public API. To use them you call component.putClientProperty(propertyName, value), for example: myJTreeInstance.putClientProperty("JTree.lineStyle", "None").

The two JTree and JToolBar? properties were reported here http://www.onjava.com/pub/a/onjava/2005/08/10/swinghacks.html?page=2 Apple has some client properties to make a Swing application integrate better, see http://developer.apple.com/technotes/tn2007/tn2196.html

Flag type Default As of Version Platform Description
JComboBox?.isTableCellEditor boolean false ? All If true, changing the selection in the drop down does not update the selected item in the ComboBox? (if L&F extends BasicComboBoxUI?)
JToolBar?.isRollover boolean false ? All(?) Turn rollover on for a JToolBar?
JTree.lineStyle String ? ? All(?) Show lines in JTree, value should be "Angled"
JTree.lineStyle String ? ? All(?) Hide lines in JTree, value should be "None"
terminateEditOnFocusLost boolean false ? All(?) Automatically stopCellEditing (or cancel if stop fails) when the JTable loses focus

The following properties are L&F properties; you should update them using UIManager.put("foo", bar); Only interresting properties are shown here; properties that should have been set to be enabled per default if Swing would have been marketed this year..

Flag type Description
Button.defaultButtonFollowsFocus boolean The JOptionpane will listen to focus change events and move the default button when the focus moves to one of the other buttons.
FileChooser?.readOnly boolean All constructed FileChoosers? will have editing of file names disabled.

Topic SecretSwingProperties . { Edit | Ref-By | Printable | Diffs r16 < r15 < r14 < r13 < r12 | More }
 XML java.net RSS

Revision r16 - 18 Mar 2009 - 08:45:12 - Main.walterln
Parents: WebHome