本文整理匯總了Java中javax.swing.plaf.ActionMapUIResource.setParent方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionMapUIResource.setParent方法的具體用法?Java ActionMapUIResource.setParent怎麽用?Java ActionMapUIResource.setParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.plaf.ActionMapUIResource
的用法示例。
在下文中一共展示了ActionMapUIResource.setParent方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: installKeyboardActions
import javax.swing.plaf.ActionMapUIResource; //導入方法依賴的package包/類
protected void installKeyboardActions() {
createInternalFrameListener();
frame.addInternalFrameListener(internalFrameListener);
ActionMapUIResource actionMap = new ActionMapUIResource();
actionMap.put("showSystemMenu", new AbstractAction() {
public void actionPerformed(final ActionEvent e) {
if (titlePane != null) {
titlePane.showSystemMenu();
}
}
});
actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel())
.getAudioActionMap());
SwingUtilities.replaceUIActionMap(frame, actionMap);
}
示例2: installKeyboardActions
import javax.swing.plaf.ActionMapUIResource; //導入方法依賴的package包/類
/**
* This method installs the keyboard actions for the JInternalFrame.
*/
protected void installKeyboardActions()
{
ActionMapUIResource am = new ActionMapUIResource();
am.put("showSystemMenu", new ShowSystemMenuAction());
// The RI impl installs the audio actions as parent of the UI action map,
// so do we.
BasicLookAndFeel blaf = (BasicLookAndFeel) UIManager.getLookAndFeel();
ActionMap audioActionMap = blaf.getAudioActionMap();
am.setParent(audioActionMap);
SwingUtilities.replaceUIActionMap(frame, am);
}