List of usage examples for javax.swing JToolTip getComponent
public JComponent getComponent()
From source file:org.underworldlabs.swing.plaf.base.AcceleratorToolTipUI.java
private String getAcceleratorString(JToolTip tip) { String acceleratorString = null; Action action = ((AbstractButton) tip.getComponent()).getAction(); if (action != null) { KeyStroke keyStroke = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY); if (keyStroke != null) { int mod = keyStroke.getModifiers(); acceleratorString = KeyEvent.getKeyModifiersText(mod); if (!MiscUtils.isNull(acceleratorString)) { acceleratorString += DELIMITER; }/*from w w w . j av a 2s.co m*/ String keyText = KeyEvent.getKeyText(keyStroke.getKeyCode()); if (!MiscUtils.isNull(keyText)) { acceleratorString += keyText; } } } return acceleratorString; }