swing里的textarea 固定大小如何在每一次button之后刷新?

我的swing界面里有几个JSplitPane控件,这种控件的默认快捷键(F8)是会在多个JSplitPane之间切换。
而JTabbedPane控件的默认快捷键(ctrl+tab)会在多个标签页之间切换。
现在我想让快捷键F8和ctrl+tab做我自己定义的事情(如弹出一个窗口之类的)。但是,我试过setAccelerator方法和用ActionMap来映射快捷键动作,但是效果还是swing自带的动作,没有执行我定义的动作。但如果我把快捷键定义为不和控件默认快捷键相同如(alt+r),就会执行我自己定义的动作。
想请问下swing达人,我要怎么做才可以使界面上有JTabbedPane控件时,按快捷键(ctrl+tab),可以执行我自己定义的动作。
采纳的答案
怎么上面那段代码没有高亮显示?
package org.zergle.test.
import java.awt.BorderL
import javax.swing.JF
import javax.swing.JP
import javax.swing.JSplitP
import javax.swing.JTabbedP
import javax.swing.SwingU
import javax.swing.UID
import javax.swing.UIM
public class TestAccelerator extends JFrame {
private JSplitPane pnl1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
private JTabbedPane pnl2 = new JTabbedPane();
private JP
public TestAccelerator() {
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.container = (JPanel) this.getContentPane();
this.pnl1.add(new JPanel(), JSplitPane.LEFT);
this.pnl1.add(new JPanel(), JSplitPane.RIGHT);
this.pnl2.add("tab1", new JPanel());
this.pnl2.add("tab2", new JPanel());
this.container.add(pnl1, BorderLayout.NORTH);
this.container.add(pnl2, BorderLayout.SOUTH);
this.setSize(600, 400);
this.setVisible(true);
* @param args
public static void main(String[] args) {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
UIManager.put(
"TabbedPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"alt R", "navigateNext",
"alt shift R", "navigatePrevious",
"ctrl PAGE_DOWN", "navigatePageDown",
"ctrl PAGE_UP", "navigatePageUp",
"ctrl UP", "requestFocus",
"ctrl KP_UP", "requestFocus"
} catch (Exception e) {
e.printStackTrace();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new TestAccelerator();
Swing组件的默认快捷键是由LookAndFeel安装的,所以要在LookAndFeel中去改,将JTabbedPane的导航快捷键改为ALT + R的代码如下:
package org.zergle.test.
import java.awt.BorderL
import javax.swing.JF
import javax.swing.JP
import javax.swing.JSplitP
import javax.swing.JTabbedP
import javax.swing.SwingU
import javax.swing.UID
import javax.swing.UIM
public class TestAccelerator extends JFrame {
private JSplitPane pnl1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
private JTabbedPane pnl2 = new JTabbedPane();
private JP
public TestAccelerator() {
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.container = (JPanel) this.getContentPane();
this.pnl1.add(new JPanel(), JSplitPane.LEFT);
this.pnl1.add(new JPanel(), JSplitPane.RIGHT);
this.pnl2.add("tab1", new JPanel());
this.pnl2.add("tab2", new JPanel());
this.container.add(pnl1, BorderLayout.NORTH);
this.container.add(pnl2, BorderLayout.SOUTH);
this.setSize(600, 400);
this.setVisible(true);
* @param args
public static void main(String[] args) {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
UIManager.put(
"TabbedPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
&&&&&&&& "alt R", "navigateNext",
&& "alt shift R", "navigatePrevious",
"ctrl PAGE_DOWN", "navigatePageDown",
& "ctrl PAGE_UP", "navigatePageUp",
&&&&&& "ctrl UP", "requestFocus",
&&& "ctrl KP_UP", "requestFocus"
} catch (Exception e) {
e.printStackTrace();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new TestAccelerator();
要知道当前LookAndFeel在组件上绑定的快捷键详细信息,请参考特定的LookAndFeel的源代码。以下是WindowsLookAndFeel的代码片段:
protected void initComponentDefaults(UIDefaults table)
super.initComponentDefaults( table );
initResourceBundle(table);
// *** Shared Fonts
Integer twelve = new Integer(12);
Integer eight = new Integer(8);
Integer ten = new Integer(10);
Integer fontPlain = new Integer(Font.PLAIN);
Integer fontBold = new Integer(Font.BOLD);
Object dialogPlain12 = new SwingLazyValue(
"javax.swing.plaf.FontUIResource",
new Object[] {Font.DIALOG, fontPlain, twelve});
Object sansSerifPlain12 =
new SwingLazyValue(
"javax.swing.plaf.FontUIResource",
new Object[] {Font.SANS_SERIF, fontPlain, twelve});
Object monospacedPlain12 = new SwingLazyValue(
"javax.swing.plaf.FontUIResource",
new Object[] {Font.MONOSPACED, fontPlain, twelve});
Object dialogBold12 = new SwingLazyValue(
"javax.swing.plaf.FontUIResource",
new Object[] {Font.DIALOG, fontBold, twelve});
// *** Colors
// XXX - some of these doens't seem to be used
ColorUIResource red = new ColorUIResource(Color.red);
ColorUIResource black = new ColorUIResource(Color.black);
ColorUIResource white = new ColorUIResource(Color.white);
ColorUIResource yellow = new ColorUIResource(Color.yellow);
ColorUIResource gray = new ColorUIResource(Color.gray);
ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
ColorUIResource scrollBarTrack = lightG
ColorUIResource scrollBarTrackHighlight = darkG
// Set the flag which determines which version of Windows should
// be rendered. This flag only need to be set once.
// if version &= 4.0 then the classic LAF should be loaded.
String osVersion = System.getProperty("os.version");
if (osVersion != null) {
Float version = Float.valueOf(osVersion);
if (version.floatValue() &= 4.0) {
isClassicWindows =
isClassicWindows =
} catch (NumberFormatException ex) {
isClassicWindows =
// *** Tree
ColorUIResource treeSelection = new ColorUIResource(0, 0, 128);
Object treeExpandedIcon = WindowsTreeUI.ExpandedIcon.createExpandedIcon();
Object treeCollapsedIcon = WindowsTreeUI.CollapsedIcon.createCollapsedIcon();
// *** Text
Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] {
"control C", DefaultEditorKit.copyAction,
"control V", DefaultEditorKit.pasteAction,
"control X", DefaultEditorKit.cutAction,
"COPY", DefaultEditorKit.copyAction,
"PASTE", DefaultEditorKit.pasteAction,
"CUT", DefaultEditorKit.cutAction,
"control INSERT", DefaultEditorKit.copyAction,
"shift INSERT", DefaultEditorKit.pasteAction,
"shift DELETE", DefaultEditorKit.cutAction,
"control A", DefaultEditorKit.selectAllAction,
"control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
"shift LEFT", DefaultEditorKit.selectionBackwardAction,
"shift RIGHT", DefaultEditorKit.selectionForwardAction,
"control LEFT", DefaultEditorKit.previousWordAction,
"control RIGHT", DefaultEditorKit.nextWordAction,
"control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
"control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
"HOME", DefaultEditorKit.beginLineAction,
"END", DefaultEditorKit.endLineAction,
"shift HOME", DefaultEditorKit.selectionBeginLineAction,
"shift END", DefaultEditorKit.selectionEndLineAction,
"BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"ctrl H", DefaultEditorKit.deletePrevCharAction,
"DELETE", DefaultEditorKit.deleteNextCharAction,
"ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
"ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
"RIGHT", DefaultEditorKit.forwardAction,
"LEFT", DefaultEditorKit.backwardAction,
"KP_RIGHT", DefaultEditorKit.forwardAction,
"KP_LEFT", DefaultEditorKit.backwardAction,
"ENTER", JTextField.notifyAction,
"control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[] {
"control C", DefaultEditorKit.copyAction,
"control V", DefaultEditorKit.pasteAction,
"control X", DefaultEditorKit.cutAction,
"COPY", DefaultEditorKit.copyAction,
"PASTE", DefaultEditorKit.pasteAction,
"CUT", DefaultEditorKit.cutAction,
"control INSERT", DefaultEditorKit.copyAction,
"shift INSERT", DefaultEditorKit.pasteAction,
"shift DELETE", DefaultEditorKit.cutAction,
"control A", DefaultEditorKit.selectAllAction,
"control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
"shift LEFT", DefaultEditorKit.selectionBackwardAction,
"shift RIGHT", DefaultEditorKit.selectionForwardAction,
"control LEFT", DefaultEditorKit.beginLineAction,
"control RIGHT", DefaultEditorKit.endLineAction,
"control shift LEFT", DefaultEditorKit.selectionBeginLineAction,
"control shift RIGHT", DefaultEditorKit.selectionEndLineAction,
"HOME", DefaultEditorKit.beginLineAction,
"END", DefaultEditorKit.endLineAction,
"shift HOME", DefaultEditorKit.selectionBeginLineAction,
"shift END", DefaultEditorKit.selectionEndLineAction,
"BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"ctrl H", DefaultEditorKit.deletePrevCharAction,
"DELETE", DefaultEditorKit.deleteNextCharAction,
"RIGHT", DefaultEditorKit.forwardAction,
"LEFT", DefaultEditorKit.backwardAction,
"KP_RIGHT", DefaultEditorKit.forwardAction,
"KP_LEFT", DefaultEditorKit.backwardAction,
"ENTER", JTextField.notifyAction,
"control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] {
"control C", DefaultEditorKit.copyAction,
"control V", DefaultEditorKit.pasteAction,
"control X", DefaultEditorKit.cutAction,
"COPY", DefaultEditorKit.copyAction,
"PASTE", DefaultEditorKit.pasteAction,
"CUT", DefaultEditorKit.cutAction,
"control INSERT", DefaultEditorKit.copyAction,
"shift INSERT", DefaultEditorKit.pasteAction,
"shift DELETE", DefaultEditorKit.cutAction,
"shift LEFT", DefaultEditorKit.selectionBackwardAction,
"shift RIGHT", DefaultEditorKit.selectionForwardAction,
"control LEFT", DefaultEditorKit.previousWordAction,
"control RIGHT", DefaultEditorKit.nextWordAction,
"control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
"control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
"control A", DefaultEditorKit.selectAllAction,
"control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
"HOME", DefaultEditorKit.beginLineAction,
"END", DefaultEditorKit.endLineAction,
"shift HOME", DefaultEditorKit.selectionBeginLineAction,
"shift END", DefaultEditorKit.selectionEndLineAction,
"control HOME", DefaultEditorKit.beginAction,
"control END", DefaultEditorKit.endAction,
"control shift HOME", DefaultEditorKit.selectionBeginAction,
"control shift END", DefaultEditorKit.selectionEndAction,
"UP", DefaultEditorKit.upAction,
"DOWN", DefaultEditorKit.downAction,
"BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"ctrl H", DefaultEditorKit.deletePrevCharAction,
"DELETE", DefaultEditorKit.deleteNextCharAction,
"ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
"ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
"RIGHT", DefaultEditorKit.forwardAction,
"LEFT", DefaultEditorKit.backwardAction,
"KP_RIGHT", DefaultEditorKit.forwardAction,
"KP_LEFT", DefaultEditorKit.backwardAction,
"PAGE_UP", DefaultEditorKit.pageUpAction,
"PAGE_DOWN", DefaultEditorKit.pageDownAction,
"shift PAGE_UP", "selection-page-up",
"shift PAGE_DOWN", "selection-page-down",
"ctrl shift PAGE_UP", "selection-page-left",
"ctrl shift PAGE_DOWN", "selection-page-right",
"shift UP", DefaultEditorKit.selectionUpAction,
"shift DOWN", DefaultEditorKit.selectionDownAction,
"ENTER", DefaultEditorKit.insertBreakAction,
"TAB", DefaultEditorKit.insertTabAction,
"control T", "next-link-action",
"control shift T", "previous-link-action",
"control SPACE", "activate-link-action",
"control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
Object menuItemAcceleratorDelimiter = new String("+");
Object ControlBackgroundColor = new DesktopProperty(
"win.3d.backgroundColor",
table.get("control"),
Object ControlLightColor
= new DesktopProperty(
"win.3d.lightColor",
table.get("controlHighlight"),
Object ControlHighlightColor
= new DesktopProperty(
"win.3d.highlightColor",
table.get("controlLtHighlight"),
Object ControlShadowColor
= new DesktopProperty(
"win.3d.shadowColor",
table.get("controlShadow"),
Object ControlDarkShadowColor = new DesktopProperty(
"win.3d.darkShadowColor",
table.get("controlDkShadow"),
Object ControlTextColor
= new DesktopProperty(
"win.button.textColor",
table.get("controlText"),
Object MenuBackgroundColor
= new DesktopProperty(
"win.menu.backgroundColor",
table.get("menu"),
Object MenuBarBackgroundColor = new DesktopProperty(
"win.menubar.backgroundColor",
table.get("menu"),
Object MenuTextColor
= new DesktopProperty(
"win.menu.textColor",
table.get("menuText"),
Object SelectionBackgroundColor = new DesktopProperty(
"win.item.highlightColor",
table.get("textHighlight"),
Object SelectionTextColor
= new DesktopProperty(
"win.item.highlightTextColor",
table.get("textHighlightText"),
Object WindowBackgroundColor
= new DesktopProperty(
"win.frame.backgroundColor",
table.get("window"),
Object WindowTextColor
= new DesktopProperty(
"win.frame.textColor",
table.get("windowText"),
Object WindowBorderWidth
= new DesktopProperty(
"win.frame.sizingBorderWidth",
new Integer(1),
Object TitlePaneHeight
= new DesktopProperty(
"win.frame.captionHeight",
new Integer(18),
Object TitleButtonWidth
= new DesktopProperty(
"win.frame.captionButtonWidth",
new Integer(16),
Object TitleButtonHeight
= new DesktopProperty(
"win.frame.captionButtonHeight",
new Integer(16),
Object InactiveTextColor
= new DesktopProperty(
"win.text.grayedTextColor",
table.get("textInactiveText"),
Object ScrollbarBackgroundColor = new DesktopProperty(
"win.scrollbar.backgroundColor",
table.get("scrollbar"),
Object TextBackground
= new XPColorValue(Part.EP_EDIT, null, Prop.FILLCOLOR,
WindowBackgroundColor);
//The following four lines were commented out as part of bug 4991597
//This code *is* correct, however it differs from WindowsXP and is, apparently
//a Windows XP bug. Until Windows fixes this bug, we shall also exhibit the same
//behavior
//Object ReadOnlyTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.READONLY, Prop.FILLCOLOR,
ControlBackgroundColor);
//Object DisabledTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.DISABLED, Prop.FILLCOLOR,
ControlBackgroundColor);
Object ReadOnlyTextBackground = ControlBackgroundC
Object DisabledTextBackground = ControlBackgroundC
Object MenuFont = dialogPlain12;
Object FixedControlFont = monospacedPlain12;
Object ControlFont = dialogPlain12;
Object MessageFont = dialogPlain12;
Object WindowFont = dialogBold12;
Object ToolTipFont = sansSerifPlain12;
Object IconFont = ControlF
Object scrollBarWidth = new DesktopProperty("win.scrollbar.width",
new Integer(16), toolkit);
Object menuBarHeight = new DesktopProperty("win.menu.height",
null, toolkit);
Object hotTrackingOn = new DesktopProperty("win.item.hotTrackingOn",
true, toolkit);
Object showMnemonics = new DesktopProperty("win.menu.keyboardCuesOn",
Boolean.TRUE, toolkit);
if (useSystemFontSettings) {
MenuFont = getDesktopFontValue("win.menu.font", MenuFont, toolkit);
FixedControlFont = getDesktopFontValue("win.ansiFixed.font",
FixedControlFont, toolkit);
ControlFont = getDesktopFontValue("win.defaultGUI.font",
ControlFont, toolkit);
MessageFont = getDesktopFontValue("win.messagebox.font",
MessageFont, toolkit);
WindowFont = getDesktopFontValue("win.frame.captionFont",
WindowFont, toolkit);
= getDesktopFontValue("win.icon.font",
IconFont, toolkit);
ToolTipFont = getDesktopFontValue("win.tooltip.font", ToolTipFont,
/* Put the desktop AA settings in the defaults.
* JComponent.setUI() retrieves this and makes it available
* as a client property on the JComponent. Use the same key name
* for both client property and UIDefaults.
* Also need to set up listeners for changes in these settings.
Object aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(true);
table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
this.aaSettings =
new FontDesktopProperty(SunToolkit.DESKTOPFONTHINTS);
if (useSystemFontSizeSettings) {
MenuFont = new WindowsFontSizeProperty("win.menu.font.height",
toolkit, Font.DIALOG, Font.PLAIN, 12);
FixedControlFont = new WindowsFontSizeProperty(
"win.ansiFixed.font.height", toolkit, Font.MONOSPACED,
Font.PLAIN, 12);
ControlFont = new WindowsFontSizeProperty(
"win.defaultGUI.font.height", toolkit, Font.DIALOG,
Font.PLAIN, 12);
MessageFont = new WindowsFontSizeProperty(
"win.messagebox.font.height",
toolkit, Font.DIALOG, Font.PLAIN, 12);
WindowFont = new WindowsFontSizeProperty(
"win.frame.captionFont.height", toolkit,
Font.DIALOG, Font.BOLD, 12);
ToolTipFont = new WindowsFontSizeProperty(
"win.tooltip.font.height", toolkit, Font.SANS_SERIF,
Font.PLAIN, 12);
= new WindowsFontSizeProperty(
"win.icon.font.height", toolkit, Font.DIALOG,
Font.PLAIN, 12);
if (!(this instanceof WindowsClassicLookAndFeel) &&
(System.getProperty("os.name").startsWith("Windows ") &&
System.getProperty("os.version").compareTo("5.1") &= 0) &&
AccessController.doPrivileged(new GetPropertyAction("swing.noxp")) == null) {
// These desktop properties are not used directly, but are needed to
// trigger realoading of UI's.
this.themeActive = new TriggerDesktopProperty("win.xpstyle.themeActive");
this.dllName
= new TriggerDesktopProperty("win.xpstyle.dllName");
this.colorName
= new TriggerDesktopProperty("win.xpstyle.colorName");
this.sizeName
= new TriggerDesktopProperty("win.xpstyle.sizeName");
Object[] defaults = {
// *** Auditory Feedback
// this key defines which of the various cues to render
// Overridden from BasicL&F. This L&F should play all sounds
// all the time. The infrastructure decides what to play.
// This is disabled until sound bugs can be resolved.
"AuditoryCues.playList", null, // table.get("AuditoryCues.cueList"),
"Application.useSystemFontSettings", Boolean.valueOf(useSystemFontSettings),
"TextField.focusInputMap", fieldInputMap,
"PasswordField.focusInputMap", passwordInputMap,
"TextArea.focusInputMap", multilineInputMap,
"TextPane.focusInputMap", multilineInputMap,
"EditorPane.focusInputMap", multilineInputMap,
// Buttons
"Button.font", ControlFont,
"Button.background", ControlBackgroundColor,
// Button.foreground, Button.shadow, Button.darkShadow,
// Button.disabledForground, and Button.disabledShadow are only
// used for Windows Classic. Windows XP will use colors
// from the current visual style.
"Button.foreground", ControlTextColor,
"Button.shadow", ControlShadowColor,
"Button.darkShadow", ControlDarkShadowColor,
"Button.light", ControlLightColor,
"Button.highlight", ControlHighlightColor,
"Button.disabledForeground", InactiveTextColor,
"Button.disabledShadow", ControlHighlightColor,
"Button.focus", black,
"Button.dashedRectGapX", new XPValue(new Integer(3), new Integer(5)),
"Button.dashedRectGapY", new XPValue(new Integer(3), new Integer(4)),
"Button.dashedRectGapWidth", new XPValue(new Integer(6), new Integer(10)),
"Button.dashedRectGapHeight", new XPValue(new Integer(6), new Integer(8)),
"Button.textShiftOffset", new XPValue(new Integer(0),
new Integer(1)),
// W2K keyboard navigation hidding.
"Button.showMnemonics", showMnemonics,
"Button.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"SPACE", "pressed",
"released SPACE", "released"
"CheckBox.font", ControlFont,
"CheckBox.interiorBackground", WindowBackgroundColor,
"CheckBox.background", ControlBackgroundColor,
"CheckBox.foreground", WindowTextColor,
"CheckBox.shadow", ControlShadowColor,
"CheckBox.darkShadow", ControlDarkShadowColor,
"CheckBox.light", ControlLightColor,
"CheckBox.highlight", ControlHighlightColor,
"CheckBox.focus", black,
"CheckBox.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"SPACE", "pressed",
"released SPACE", "released"
// margin is 2 all the way around, BasicBorders.RadioButtonBorder
// (checkbox uses RadioButtonBorder) is 2 all the way around too.
"CheckBox.totalInsets", new Insets(4, 4, 4, 4),
"CheckBoxMenuItem.font", MenuFont,
"CheckBoxMenuItem.background", MenuBackgroundColor,
"CheckBoxMenuItem.foreground", MenuTextColor,
"CheckBoxMenuItem.selectionForeground", SelectionTextColor,
"CheckBoxMenuItem.selectionBackground", SelectionBackgroundColor,
"CheckBoxMenuItem.acceleratorForeground", MenuTextColor,
"CheckBoxMenuItem.acceleratorSelectionForeground", SelectionTextColor,
"mandSound", "win.sound.menuCommand",
"ComboBox.font", ControlFont,
"ComboBox.background", WindowBackgroundColor,
"ComboBox.foreground", WindowTextColor,
"ComboBox.buttonBackground", ControlBackgroundColor,
"ComboBox.buttonShadow", ControlShadowColor,
"ComboBox.buttonDarkShadow", ControlDarkShadowColor,
"ComboBox.buttonHighlight", ControlHighlightColor,
"ComboBox.selectionBackground", SelectionBackgroundColor,
"ComboBox.selectionForeground", SelectionTextColor,
"ComboBox.editorBorder", new XPValue(new EmptyBorder(1,2,1,1),
new EmptyBorder(1,4,1,4)),
"ComboBox.disabledBackground",
new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
Prop.FILLCOLOR, DisabledTextBackground),
"ComboBox.disabledForeground",
new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
Prop.TEXTCOLOR, InactiveTextColor),
"ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
"ESCAPE", "hidePopup",
"PAGE_UP", "pageUpPassThrough",
"PAGE_DOWN", "pageDownPassThrough",
"HOME", "homePassThrough",
"END", "endPassThrough",
"DOWN", "selectNext2",
"KP_DOWN", "selectNext2",
"UP", "selectPrevious2",
"KP_UP", "selectPrevious2",
"ENTER", "enterPressed",
"F4", "togglePopup",
"alt DOWN", "togglePopup",
"alt KP_DOWN", "togglePopup",
"alt UP", "togglePopup",
"alt KP_UP", "togglePopup"
// DeskTop.
"Desktop.background", new DesktopProperty(
"win.desktop.backgroundColor",
table.get("desktop"),
"Desktop.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"ctrl F5", "restore",
"ctrl F4", "close",
"ctrl F7", "move",
"ctrl F8", "resize",
"RIGHT", "right",
"KP_RIGHT", "right",
"LEFT", "left",
"KP_LEFT", "left",
"UP", "up",
"KP_UP", "up",
"DOWN", "down",
"KP_DOWN", "down",
"ESCAPE", "escape",
"ctrl F9", "minimize",
"ctrl F10", "maximize",
"ctrl F6", "selectNextFrame",
"ctrl TAB", "selectNextFrame",
"ctrl alt F6", "selectNextFrame",
"shift ctrl alt F6", "selectPreviousFrame",
"ctrl F12", "navigateNext",
"shift ctrl F12", "navigatePrevious"
// DesktopIcon
"DesktopIcon.width", new Integer(160),
"EditorPane.font", ControlFont,
"EditorPane.background", WindowBackgroundColor,
"EditorPane.foreground", WindowTextColor,
"EditorPane.selectionBackground", SelectionBackgroundColor,
"EditorPane.selectionForeground", SelectionTextColor,
"EditorPane.caretForeground", WindowTextColor,
"EditorPane.inactiveForeground", InactiveTextColor,
"EditorPane.inactiveBackground", WindowBackgroundColor,
"EditorPane.disabledBackground", DisabledTextBackground,
"FileChooser.homeFolderIcon",
new LazyWindowsIcon(null,
"icons/HomeFolder.gif"),
"FileChooser.listFont", IconFont,
"FileChooser.listViewBackground", new XPColorValue(Part.LVP_LISTVIEW, null, Prop.FILLCOLOR,
WindowBackgroundColor),
"FileChooser.listViewBorder", new XPBorderValue(Part.LVP_LISTVIEW,
new SwingLazyValue(
"javax.swing.plaf.BorderUIResource",
"getLoweredBevelBorderUIResource")),
"FileChooser.listViewIcon",
new LazyWindowsIcon("fileChooserIcon ListView",
"icons/ListView.gif"),
"FileChooser.listViewWindowsStyle", Boolean.TRUE,
"FileChooser.detailsViewIcon", new LazyWindowsIcon("fileChooserIcon DetailsView",
"icons/DetailsView.gif"),
"FileChooser.upFolderIcon",
new LazyWindowsIcon("fileChooserIcon UpFolder",
"icons/UpFolder.gif"),
"FileChooser.newFolderIcon",
new LazyWindowsIcon("fileChooserIcon NewFolder",
"icons/NewFolder.gif"),
"FileChooser.useSystemExtensionHiding", Boolean.TRUE,
"FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I),
"FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N),
"FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T),
"FileChooser.usesSingleFilePane", Boolean.TRUE,
"FileChooser.noPlacesBar", new DesktopProperty("dlg.noPlacesBar",
Boolean.FALSE, toolkit),
"FileChooser.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"ESCAPE", "cancelSelection",
"F2", "editFileName",
"F5", "refresh",
"BACK_SPACE", "Go Up",
"ENTER", "approveSelection",
"ctrl ENTER", "approveSelection"
"FileView.directoryIcon", SwingUtilities2.makeIcon(getClass(),
WindowsLookAndFeel.class,
"icons/Directory.gif"),
"FileView.fileIcon", SwingUtilities2.makeIcon(getClass(),
WindowsLookAndFeel.class,
"icons/File.gif"),
"puterIcon", SwingUtilities2.makeIcon(getClass(),
WindowsLookAndFeel.class,
"icons/Computer.gif"),
"FileView.hardDriveIcon", SwingUtilities2.makeIcon(getClass(),
WindowsLookAndFeel.class,
"icons/HardDrive.gif"),
"FileView.floppyDriveIcon", SwingUtilities2.makeIcon(getClass(),
WindowsLookAndFeel.class,
"icons/FloppyDrive.gif"),
"FormattedTextField.font", ControlFont,
"InternalFrame.titleFont", WindowFont,
"InternalFrame.titlePaneHeight",
TitlePaneHeight,
"InternalFrame.titleButtonWidth",
TitleButtonWidth,
"InternalFrame.titleButtonHeight", TitleButtonHeight,
"InternalFrame.titleButtonToolTipsOn", hotTrackingOn,
"InternalFrame.borderColor", ControlBackgroundColor,
"InternalFrame.borderShadow", ControlShadowColor,
"InternalFrame.borderDarkShadow", ControlDarkShadowColor,
"InternalFrame.borderHighlight", ControlHighlightColor,
"InternalFrame.borderLight", ControlLightColor,
"InternalFrame.borderWidth", WindowBorderWidth,
"InternalFrame.minimizeIconBackground", ControlBackgroundColor,
"InternalFrame.resizeIconHighlight", ControlLightColor,
"InternalFrame.resizeIconShadow", ControlShadowColor,
"InternalFrame.activeBorderColor", new DesktopProperty(
"win.frame.activeBorderColor",
table.get("windowBorder"),
"InternalFrame.inactiveBorderColor", new DesktopProperty(
"win.frame.inactiveBorderColor",
table.get("windowBorder"),
"InternalFrame.activeTitleBackground", new DesktopProperty(
"win.frame.activeCaptionColor",
table.get("activeCaption"),
"InternalFrame.activeTitleGradient", new DesktopProperty(
"win.frame.activeCaptionGradientColor",
table.get("activeCaption"),
"InternalFrame.activeTitleForeground", new DesktopProperty(
"win.frame.captionTextColor",
table.get("activeCaptionText"),
"InternalFrame.inactiveTitleBackground", new DesktopProperty(
"win.frame.inactiveCaptionColor",
table.get("inactiveCaption"),
"InternalFrame.inactiveTitleGradient", new DesktopProperty(
"win.frame.inactiveCaptionGradientColor",
table.get("inactiveCaption"),
"InternalFrame.inactiveTitleForeground", new DesktopProperty(
"win.frame.inactiveCaptionTextColor",
table.get("inactiveCaptionText"),
"InternalFrame.maximizeIcon",
WindowsIconFactory.createFrameMaximizeIcon(),
"InternalFrame.minimizeIcon",
WindowsIconFactory.createFrameMinimizeIcon(),
"InternalFrame.iconifyIcon",
WindowsIconFactory.createFrameIconifyIcon(),
"InternalFrame.closeIcon",
WindowsIconFactory.createFrameCloseIcon(),
"InternalFrame.icon",
new SwingLazyValue(
"com.sun.java.swing.plaf.windows.WindowsInternalFrameTitlePane$ScalableIconUIResource",
// The constructor takes one arg: an array of UIDefaults.LazyValue
// representing the icons
new Object[][] { {
SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/JavaCup16.png"),
SwingUtilities2.makeIcon(getClass(), WindowsLookAndFeel.class, "icons/JavaCup32.png")
// Internal Frame Auditory Cue Mappings
"InternalFrame.closeSound", "win.sound.close",
"InternalFrame.maximizeSound", "win.sound.maximize",
"InternalFrame.minimizeSound", "win.sound.minimize",
"InternalFrame.restoreDownSound", "win.sound.restoreDown",
"InternalFrame.restoreUpSound", "win.sound.restoreUp",
"InternalFrame.windowBindings", new Object[] {
"shift ESCAPE", "showSystemMenu",
"ctrl SPACE", "showSystemMenu",
"ESCAPE", "hideSystemMenu"},
"Label.font", ControlFont,
"Label.background", ControlBackgroundColor,
"Label.foreground", WindowTextColor,
"Label.disabledForeground", InactiveTextColor,
"Label.disabledShadow", ControlHighlightColor,
"List.font", ControlFont,
"List.background", WindowBackgroundColor,
"List.foreground", WindowTextColor,
"List.selectionBackground", SelectionBackgroundColor,
"List.selectionForeground", SelectionTextColor,
"List.lockToPositionOnScroll", Boolean.TRUE,
"List.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"ctrl C", "copy",
"ctrl V", "paste",
"ctrl X", "cut",
"COPY", "copy",
"PASTE", "paste",
"CUT", "cut",
"control INSERT", "copy",
"shift INSERT", "paste",
"shift DELETE", "cut",
"UP", "selectPreviousRow",
"KP_UP", "selectPreviousRow",
"shift UP", "selectPreviousRowExtendSelection",
"shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl shift UP", "selectPreviousRowExtendSelection",
"ctrl shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl UP", "selectPreviousRowChangeLead",
"ctrl KP_UP", "selectPreviousRowChangeLead",
"DOWN", "selectNextRow",
"KP_DOWN", "selectNextRow",
"shift DOWN", "selectNextRowExtendSelection",
"shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl shift DOWN", "selectNextRowExtendSelection",
"ctrl shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl DOWN", "selectNextRowChangeLead",
"ctrl KP_DOWN", "selectNextRowChangeLead",
"LEFT", "selectPreviousColumn",
"KP_LEFT", "selectPreviousColumn",
"shift LEFT", "selectPreviousColumnExtendSelection",
"shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl LEFT", "selectPreviousColumnChangeLead",
"ctrl KP_LEFT", "selectPreviousColumnChangeLead",
"RIGHT", "selectNextColumn",
"KP_RIGHT", "selectNextColumn",
"shift RIGHT", "selectNextColumnExtendSelection",
"shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl shift RIGHT", "selectNextColumnExtendSelection",
"ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl RIGHT", "selectNextColumnChangeLead",
"ctrl KP_RIGHT", "selectNextColumnChangeLead",
"HOME", "selectFirstRow",
"shift HOME", "selectFirstRowExtendSelection",
"ctrl shift HOME", "selectFirstRowExtendSelection",
"ctrl HOME", "selectFirstRowChangeLead",
"END", "selectLastRow",
"shift END", "selectLastRowExtendSelection",
"ctrl shift END", "selectLastRowExtendSelection",
"ctrl END", "selectLastRowChangeLead",
"PAGE_UP", "scrollUp",
"shift PAGE_UP", "scrollUpExtendSelection",
"ctrl shift PAGE_UP", "scrollUpExtendSelection",
"ctrl PAGE_UP", "scrollUpChangeLead",
"PAGE_DOWN", "scrollDown",
"shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl PAGE_DOWN", "scrollDownChangeLead",
"ctrl A", "selectAll",
"ctrl SLASH", "selectAll",
"ctrl BACK_SLASH", "clearSelection",
"SPACE", "addToSelection",
"ctrl SPACE", "toggleAndAnchor",
"shift SPACE", "extendTo",
"ctrl shift SPACE", "moveSelectionTo"
// PopupMenu
"PopupMenu.font", MenuFont,
"PopupMenu.background", MenuBackgroundColor,
"PopupMenu.foreground", MenuTextColor,
"PopupMenu.popupSound", "win.sound.menuPopup",
"PopupMenu.consumeEventOnClose", Boolean.TRUE,
"Menu.font", MenuFont,
"Menu.foreground", MenuTextColor,
"Menu.background", MenuBackgroundColor,
"Menu.useMenuBarBackgroundForTopLevel", Boolean.TRUE,
"Menu.selectionForeground", SelectionTextColor,
"Menu.selectionBackground", SelectionBackgroundColor,
"Menu.acceleratorForeground", MenuTextColor,
"Menu.acceleratorSelectionForeground", SelectionTextColor,
"Menu.menuPopupOffsetX", new Integer(0),
"Menu.menuPopupOffsetY", new Integer(0),
"Menu.submenuPopupOffsetX", new Integer(-4),
"Menu.submenuPopupOffsetY", new Integer(-3),
"Menu.crossMenuMnemonic", Boolean.FALSE,
// MenuBar.
"MenuBar.font", MenuFont,
"MenuBar.background", new XPValue(MenuBarBackgroundColor,
MenuBackgroundColor),
"MenuBar.foreground", MenuTextColor,
"MenuBar.shadow", ControlShadowColor,
"MenuBar.highlight", ControlHighlightColor,
"MenuBar.height", menuBarHeight,
"MenuBar.rolloverEnabled", hotTrackingOn,
"MenuBar.windowBindings", new Object[] {
"F10", "takeFocus" },
"MenuItem.font", MenuFont,
"MenuItem.acceleratorFont", MenuFont,
"MenuItem.foreground", MenuTextColor,
"MenuItem.background", MenuBackgroundColor,
"MenuItem.selectionForeground", SelectionTextColor,
"MenuItem.selectionBackground", SelectionBackgroundColor,
"MenuItem.disabledForeground", InactiveTextColor,
"MenuItem.acceleratorForeground", MenuTextColor,
"MenuItem.acceleratorSelectionForeground", SelectionTextColor,
"MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
// Menu Item Auditory Cue Mapping
"mandSound", "win.sound.menuCommand",
// indicates that keyboard navigation won't skip disabled menu items
"MenuItem.disabledAreNavigable", Boolean.TRUE,
"RadioButton.font", ControlFont,
"RadioButton.interiorBackground", WindowBackgroundColor,
"RadioButton.background", ControlBackgroundColor,
"RadioButton.foreground", WindowTextColor,
"RadioButton.shadow", ControlShadowColor,
"RadioButton.darkShadow", ControlDarkShadowColor,
"RadioButton.light", ControlLightColor,
"RadioButton.highlight", ControlHighlightColor,
"RadioButton.focus", black,
"RadioButton.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"SPACE", "pressed",
"released SPACE", "released"
// margin is 2 all the way around, BasicBorders.RadioButtonBorder
// is 2 all the way around too.
"RadioButton.totalInsets", new Insets(4, 4, 4, 4),
"RadioButtonMenuItem.font", MenuFont,
"RadioButtonMenuItem.foreground", MenuTextColor,
"RadioButtonMenuItem.background", MenuBackgroundColor,
"RadioButtonMenuItem.selectionForeground", SelectionTextColor,
"RadioButtonMenuItem.selectionBackground", SelectionBackgroundColor,
"RadioButtonMenuItem.disabledForeground", InactiveTextColor,
"RadioButtonMenuItem.acceleratorForeground", MenuTextColor,
"RadioButtonMenuItem.acceleratorSelectionForeground", SelectionTextColor,
"mandSound", "win.sound.menuCommand",
// OptionPane.
"OptionPane.font", MessageFont,
"OptionPane.messageFont", MessageFont,
"OptionPane.buttonFont", MessageFont,
"OptionPane.background", ControlBackgroundColor,
"OptionPane.foreground", WindowTextColor,
"OptionPane.buttonMinimumWidth", new XPDLUValue(50, 50, SwingConstants.EAST),
"OptionPane.messageForeground", ControlTextColor,
"OptionPane.errorIcon",
new LazyWindowsIcon("optionPaneIcon Error",
"icons/Error.gif"),
"rmationIcon", new LazyWindowsIcon("optionPaneIcon Information",
"icons/Inform.gif"),
"OptionPane.questionIcon",
new LazyWindowsIcon("optionPaneIcon Question",
"icons/Question.gif"),
"OptionPane.warningIcon",
new LazyWindowsIcon("optionPaneIcon Warning",
"icons/Warn.gif"),
"OptionPane.windowBindings", new Object[] {
"ESCAPE", "close" },
// Option Pane Auditory Cue Mappings
"OptionPane.errorSound", "win.sound.hand", // Error
"rmationSound", "win.sound.asterisk", // Info Plain
"OptionPane.questionSound", "win.sound.question", // Question
"OptionPane.warningSound", "win.sound.exclamation", // Warning
"FormattedTextField.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"ctrl C", DefaultEditorKit.copyAction,
"ctrl V", DefaultEditorKit.pasteAction,
"ctrl X", DefaultEditorKit.cutAction,
"COPY", DefaultEditorKit.copyAction,
"PASTE", DefaultEditorKit.pasteAction,
"CUT", DefaultEditorKit.cutAction,
"control INSERT", DefaultEditorKit.copyAction,
"shift INSERT", DefaultEditorKit.pasteAction,
"shift DELETE", DefaultEditorKit.cutAction,
"shift LEFT", DefaultEditorKit.selectionBackwardAction,
"shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
"shift RIGHT", DefaultEditorKit.selectionForwardAction,
"shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
"ctrl LEFT", DefaultEditorKit.previousWordAction,
"ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
"ctrl RIGHT", DefaultEditorKit.nextWordAction,
"ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
"ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
"ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
"ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
"ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
"ctrl A", DefaultEditorKit.selectAllAction,
"HOME", DefaultEditorKit.beginLineAction,
"END", DefaultEditorKit.endLineAction,
"shift HOME", DefaultEditorKit.selectionBeginLineAction,
"shift END", DefaultEditorKit.selectionEndLineAction,
"BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"ctrl H", DefaultEditorKit.deletePrevCharAction,
"DELETE", DefaultEditorKit.deleteNextCharAction,
"ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
"ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
"RIGHT", DefaultEditorKit.forwardAction,
"LEFT", DefaultEditorKit.backwardAction,
"KP_RIGHT", DefaultEditorKit.forwardAction,
"KP_LEFT", DefaultEditorKit.backwardAction,
"ENTER", JTextField.notifyAction,
"ctrl BACK_SLASH", "unselect",
"control shift O", "toggle-componentOrientation",
"ESCAPE", "reset-field-edit",
"UP", "increment",
"KP_UP", "increment",
"DOWN", "decrement",
"KP_DOWN", "decrement",
"FormattedTextField.inactiveBackground", ReadOnlyTextBackground,
"FormattedTextField.disabledBackground", DisabledTextBackground,
// *** Panel
"Panel.font", ControlFont,
"Panel.background", ControlBackgroundColor,
"Panel.foreground", WindowTextColor,
// *** PasswordField
"PasswordField.font", ControlFont,
"PasswordField.background", TextBackground,
"PasswordField.foreground", WindowTextColor,
"PasswordField.inactiveForeground", InactiveTextColor,
// for disabled
"PasswordField.inactiveBackground", ReadOnlyTextBackground, // for readonly
"PasswordField.disabledBackground", DisabledTextBackground, // for disabled
"PasswordField.selectionBackground", SelectionBackgroundColor,
"PasswordField.selectionForeground", SelectionTextColor,
"PasswordField.caretForeground",WindowTextColor,
"PasswordField.echoChar", new XPValue(new Character((char)0x25CF),
new Character('*')),
// *** ProgressBar
"ProgressBar.font", ControlFont,
"ProgressBar.foreground",
SelectionBackgroundColor,
"ProgressBar.background", ControlBackgroundColor,
"ProgressBar.shadow", ControlShadowColor,
"ProgressBar.highlight", ControlHighlightColor,
"ProgressBar.selectionForeground", ControlBackgroundColor,
"ProgressBar.selectionBackground", SelectionBackgroundColor,
"ProgressBar.cellLength", new Integer(7),
"ProgressBar.cellSpacing", new Integer(2),
"ProgressBar.indeterminateInsets", new Insets(3, 3, 3, 3),
// *** RootPane.
// These bindings are only enabled when there is a default
// button set on the rootpane.
"RootPane.defaultButtonWindowKeyBindings", new Object[] {
"ENTER", "press",
"released ENTER", "release",
"ctrl ENTER", "press",
"ctrl released ENTER", "release"
// *** ScrollBar.
"ScrollBar.background", ScrollbarBackgroundColor,
"ScrollBar.foreground", ControlBackgroundColor,
"ScrollBar.track", white,
"ScrollBar.trackForeground", ScrollbarBackgroundColor,
"ScrollBar.trackHighlight", black,
"ScrollBar.trackHighlightForeground", scrollBarTrackHighlight,
"ScrollBar.thumb", ControlBackgroundColor,
"ScrollBar.thumbHighlight", ControlHighlightColor,
"ScrollBar.thumbDarkShadow", ControlDarkShadowColor,
"ScrollBar.thumbShadow", ControlShadowColor,
"ScrollBar.width", scrollBarWidth,
"ScrollBar.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"RIGHT", "positiveUnitIncrement",
"KP_RIGHT", "positiveUnitIncrement",
"DOWN", "positiveUnitIncrement",
"KP_DOWN", "positiveUnitIncrement",
"PAGE_DOWN", "positiveBlockIncrement",
"ctrl PAGE_DOWN", "positiveBlockIncrement",
"LEFT", "negativeUnitIncrement",
"KP_LEFT", "negativeUnitIncrement",
"UP", "negativeUnitIncrement",
"KP_UP", "negativeUnitIncrement",
"PAGE_UP", "negativeBlockIncrement",
"ctrl PAGE_UP", "negativeBlockIncrement",
"HOME", "minScroll",
"END", "maxScroll"
// *** ScrollPane.
"ScrollPane.font", ControlFont,
"ScrollPane.background", ControlBackgroundColor,
"ScrollPane.foreground", ControlTextColor,
"ScrollPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"RIGHT", "unitScrollRight",
"KP_RIGHT", "unitScrollRight",
"DOWN", "unitScrollDown",
"KP_DOWN", "unitScrollDown",
"LEFT", "unitScrollLeft",
"KP_LEFT", "unitScrollLeft",
"UP", "unitScrollUp",
"KP_UP", "unitScrollUp",
"PAGE_UP", "scrollUp",
"PAGE_DOWN", "scrollDown",
"ctrl PAGE_UP", "scrollLeft",
"ctrl PAGE_DOWN", "scrollRight",
"ctrl HOME", "scrollHome",
"ctrl END", "scrollEnd"
// *** Separator
"Separator.background", ControlHighlightColor,
"Separator.foreground", ControlShadowColor,
// *** Slider.
"Slider.font", ControlFont,
"Slider.foreground", ControlBackgroundColor,
"Slider.background", ControlBackgroundColor,
"Slider.highlight", ControlHighlightColor,
"Slider.shadow", ControlShadowColor,
"Slider.focus", ControlDarkShadowColor,
"Slider.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"RIGHT", "positiveUnitIncrement",
"KP_RIGHT", "positiveUnitIncrement",
"DOWN", "negativeUnitIncrement",
"KP_DOWN", "negativeUnitIncrement",
"PAGE_DOWN", "negativeBlockIncrement",
"LEFT", "negativeUnitIncrement",
"KP_LEFT", "negativeUnitIncrement",
"UP", "positiveUnitIncrement",
"KP_UP", "positiveUnitIncrement",
"PAGE_UP", "positiveBlockIncrement",
"HOME", "minScroll",
"END", "maxScroll"
// Spinner
"Spinner.font", ControlFont,
"Spinner.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"UP", "increment",
"KP_UP", "increment",
"DOWN", "decrement",
"KP_DOWN", "decrement",
// *** SplitPane
"SplitPane.background", ControlBackgroundColor,
"SplitPane.highlight", ControlHighlightColor,
"SplitPane.shadow", ControlShadowColor,
"SplitPane.darkShadow", ControlDarkShadowColor,
"SplitPane.dividerSize", new Integer(5),
"SplitPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"UP", "negativeIncrement",
"DOWN", "positiveIncrement",
"LEFT", "negativeIncrement",
"RIGHT", "positiveIncrement",
"KP_UP", "negativeIncrement",
"KP_DOWN", "positiveIncrement",
"KP_LEFT", "negativeIncrement",
"KP_RIGHT", "positiveIncrement",
"HOME", "selectMin",
"END", "selectMax",
"F8", "startResize",
"F6", "toggleFocus",
"ctrl TAB", "focusOutForward",
"ctrl shift TAB", "focusOutBackward"
// *** TabbedPane
"TabbedPane.tabsOverlapBorder", new XPValue(Boolean.TRUE, Boolean.FALSE),
"TabbedPane.tabInsets",
new XPValue(new InsetsUIResource(1, 4, 1, 4),
new InsetsUIResource(0, 4, 1, 4)),
"TabbedPane.tabAreaInsets",
new XPValue(new InsetsUIResource(3, 2, 2, 2),
new InsetsUIResource(3, 2, 0, 2)),
"TabbedPane.font", ControlFont,
"TabbedPane.background", ControlBackgroundColor,
"TabbedPane.foreground", ControlTextColor,
"TabbedPane.highlight", ControlHighlightColor,
"TabbedPane.light", ControlLightColor,
"TabbedPane.shadow", ControlShadowColor,
"TabbedPane.darkShadow", ControlDarkShadowColor,
"TabbedPane.focus", ControlTextColor,
"TabbedPane.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"RIGHT", "navigateRight",
"KP_RIGHT", "navigateRight",
"LEFT", "navigateLeft",
"KP_LEFT", "navigateLeft",
"UP", "navigateUp",
"KP_UP", "navigateUp",
"DOWN", "navigateDown",
"KP_DOWN", "navigateDown",
"ctrl DOWN", "requestFocusForVisibleComponent",
"ctrl KP_DOWN", "requestFocusForVisibleComponent",
"TabbedPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"ctrl TAB", "navigateNext",
"ctrl shift TAB", "navigatePrevious",
"ctrl PAGE_DOWN", "navigatePageDown",
"ctrl PAGE_UP", "navigatePageUp",
"ctrl UP", "requestFocus",
"ctrl KP_UP", "requestFocus",
// *** Table
"Table.font", ControlFont,
"Table.foreground", ControlTextColor,
// cell text color
"Table.background", WindowBackgroundColor,
// cell background color
"Table.highlight", ControlHighlightColor,
"Table.light", ControlLightColor,
"Table.shadow", ControlShadowColor,
"Table.darkShadow", ControlDarkShadowColor,
"Table.selectionForeground", SelectionTextColor,
"Table.selectionBackground", SelectionBackgroundColor,
"Table.gridColor", gray,
// grid line color
"Table.focusCellBackground", WindowBackgroundColor,
"Table.focusCellForeground", ControlTextColor,
"Table.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"ctrl C", "copy",
"ctrl V", "paste",
"ctrl X", "cut",
"COPY", "copy",
"PASTE", "paste",
"CUT", "cut",
"control INSERT", "copy",
"shift INSERT", "paste",
"shift DELETE", "cut",
"RIGHT", "selectNextColumn",
"KP_RIGHT", "selectNextColumn",
"shift RIGHT", "selectNextColumnExtendSelection",
"shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl shift RIGHT", "selectNextColumnExtendSelection",
"ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl RIGHT", "selectNextColumnChangeLead",
"ctrl KP_RIGHT", "selectNextColumnChangeLead",
"LEFT", "selectPreviousColumn",
"KP_LEFT", "selectPreviousColumn",
"shift LEFT", "selectPreviousColumnExtendSelection",
"shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl LEFT", "selectPreviousColumnChangeLead",
"ctrl KP_LEFT", "selectPreviousColumnChangeLead",
"DOWN", "selectNextRow",
"KP_DOWN", "selectNextRow",
"shift DOWN", "selectNextRowExtendSelection",
"shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl shift DOWN", "selectNextRowExtendSelection",
"ctrl shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl DOWN", "selectNextRowChangeLead",
"ctrl KP_DOWN", "selectNextRowChangeLead",
"UP", "selectPreviousRow",
"KP_UP", "selectPreviousRow",
"shift UP", "selectPreviousRowExtendSelection",
"shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl shift UP", "selectPreviousRowExtendSelection",
"ctrl shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl UP", "selectPreviousRowChangeLead",
"ctrl KP_UP", "selectPreviousRowChangeLead",
"HOME", "selectFirstColumn",
"shift HOME", "selectFirstColumnExtendSelection",
"ctrl shift HOME", "selectFirstRowExtendSelection",
"ctrl HOME", "selectFirstRow",
"END", "selectLastColumn",
"shift END", "selectLastColumnExtendSelection",
"ctrl shift END", "selectLastRowExtendSelection",
"ctrl END", "selectLastRow",
"PAGE_UP", "scrollUpChangeSelection",
"shift PAGE_UP", "scrollUpExtendSelection",
"ctrl shift PAGE_UP", "scrollLeftExtendSelection",
"ctrl PAGE_UP", "scrollLeftChangeSelection",
"PAGE_DOWN", "scrollDownChangeSelection",
"shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
"ctrl PAGE_DOWN", "scrollRightChangeSelection",
"TAB", "selectNextColumnCell",
"shift TAB", "selectPreviousColumnCell",
"ENTER", "selectNextRowCell",
"shift ENTER", "selectPreviousRowCell",
"ctrl A", "selectAll",
"ctrl SLASH", "selectAll",
"ctrl BACK_SLASH", "clearSelection",
"ESCAPE", "cancel",
"F2", "startEditing",
"SPACE", "addToSelection",
"ctrl SPACE", "toggleAndAnchor",
"shift SPACE", "extendTo",
"ctrl shift SPACE", "moveSelectionTo",
"F8", "focusHeader"
"Table.sortIconHighlight", ControlShadowColor,
"Table.sortIconLight", white,
"TableHeader.font", ControlFont,
"TableHeader.foreground", ControlTextColor, // header text color
"TableHeader.background", ControlBackgroundColor, // header background
"TableHeader.focusCellBackground",
new XPValue(XPValue.NULL_VALUE,
// use default bg from XP styles
WindowBackgroundColor), // or white bg otherwise
// *** TextArea
"TextArea.font", FixedControlFont,
"TextArea.background", WindowBackgroundColor,
"TextArea.foreground", WindowTextColor,
"TextArea.inactiveForeground", InactiveTextColor,
"TextArea.inactiveBackground", WindowBackgroundColor,
"TextArea.disabledBackground", DisabledTextBackground,
"TextArea.selectionBackground", SelectionBackgroundColor,
"TextArea.selectionForeground", SelectionTextColor,
"TextArea.caretForeground", WindowTextColor,
// *** TextField
"TextField.font", ControlFont,
"TextField.background", TextBackground,
"TextField.foreground", WindowTextColor,
"TextField.shadow", ControlShadowColor,
"TextField.darkShadow", ControlDarkShadowColor,
"TextField.light", ControlLightColor,
"TextField.highlight", ControlHighlightColor,
"TextField.inactiveForeground", InactiveTextColor,
// for disabled
"TextField.inactiveBackground", ReadOnlyTextBackground, // for readonly
"TextField.disabledBackground", DisabledTextBackground, // for disabled
"TextField.selectionBackground", SelectionBackgroundColor,
"TextField.selectionForeground", SelectionTextColor,
"TextField.caretForeground", WindowTextColor,
// *** TextPane
"TextPane.font", ControlFont,
"TextPane.background", WindowBackgroundColor,
"TextPane.foreground", WindowTextColor,
"TextPane.selectionBackground", SelectionBackgroundColor,
"TextPane.selectionForeground", SelectionTextColor,
"TextPane.inactiveBackground", WindowBackgroundColor,
"TextPane.disabledBackground", DisabledTextBackground,
"TextPane.caretForeground", WindowTextColor,
// *** TitledBorder
"TitledBorder.font", ControlFont,
"TitledBorder.titleColor",
new XPColorValue(Part.BP_GROUPBOX, null, Prop.TEXTCOLOR,
WindowTextColor),
// *** ToggleButton
"ToggleButton.font", ControlFont,
"ToggleButton.background", ControlBackgroundColor,
"ToggleButton.foreground", ControlTextColor,
"ToggleButton.shadow", ControlShadowColor,
"ToggleButton.darkShadow", ControlDarkShadowColor,
"ToggleButton.light", ControlLightColor,
"ToggleButton.highlight", ControlHighlightColor
已解决问题
未解决问题

我要回帖

更多关于 asp button 不刷新 的文章

 

随机推荐