javax.swing.JMenuItem.getToolTipText()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中javax.swing.JMenuItem.getToolTipText()方法的一些代码示例,展示了JMenuItem.getToolTipText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.getToolTipText()方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:getToolTipText

JMenuItem.getToolTipText介绍

暂无

代码示例

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = TOOLTIP_TEXT_JSDOC)
@Override
public String getToolTipText() {
  return super.getToolTipText();
}

代码示例来源:origin: CognizantQAHub/Cognizant-Intelligent-Test-Scripter

@Override
  public void actionPerformed(ActionEvent e) {
    try {
      UIControl.ctrl.loadProj(recentItem.getToolTipText());
      addentry(recentItem.getToolTipText());
      updateMenu(UIControl.ctrl.ui.recentsMenu);
    } catch (Exception ex) {
      Logger.getLogger(RecentItems.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
});

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

public void actionPerformed(ActionEvent e) {
    caller.loadFile(pathnameHistory.get(itemNbr));
    JMenuItem item = (JMenuItem) e.getSource();
    FileHistory.this.insertPathname(item.getToolTipText());
  }
}

代码示例来源:origin: org.orbisgis/orbisgis-view

/**
 * Set the selected menu item
 * If isButtonAsMenuItem, apply the icon and tooltip of the menuitem to this button
 * @param menu 
 */
public void setSelectedItem(JMenuItem menu) {
  selectedItem = menu;     
  if(buttonAsMenuItem) {
    setIcon(menu.getIcon());
    setText(menu.getText());
    setToolTipText(menu.getToolTipText());
  }
}

代码示例来源:origin: orbisgis/orbisgis

/**
 * Set the selected menu item
 * If isButtonAsMenuItem, apply the icon and tooltip of the menuitem to this button
 * @param menu 
 */
public void setSelectedItem(JMenuItem menu) {
  selectedItem = menu;     
  if(buttonAsMenuItem) {
    setIcon(menu.getIcon());
    setText(menu.getText());
    setToolTipText(menu.getToolTipText());
  }
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private JMenu cloneMenu(JMenu menu)
{
 JMenu ret = new JMenu(menu.getText());
 for (int i = 0; i < menu.getItemCount(); i++)
 {
   JMenuItem toClone = menu.getItem(i);
   if (toClone instanceof JMenu)
   {
    ret.add(cloneMenu((JMenu) toClone));
   }
   else if(toClone instanceof JMenuItem)
   {
    JMenuItem clone = new JMenuItem(toClone.getText(), toClone.getIcon());
    clone.setMnemonic(toClone.getMnemonic());
    clone.setAction(toClone.getAction());
    clone.setAccelerator(toClone.getAccelerator());
    clone.setToolTipText(toClone.getToolTipText());
    ret.add(clone);
   }
   else
   {
    ret.addSeparator();
   }
 }
 return ret;
}

代码示例来源:origin: realXuJiang/bigtable-sql

private JMenu cloneMenu(JMenu menu)
{
 JMenu ret = new JMenu(menu.getText());
 for (int i = 0; i < menu.getItemCount(); i++)
 {
   JMenuItem toClone = menu.getItem(i);
   if (toClone instanceof JMenu)
   {
    ret.add(cloneMenu((JMenu) toClone));
   }
   else if(toClone instanceof JMenuItem)
   {
    JMenuItem clone = new JMenuItem(toClone.getText(), toClone.getIcon());
    clone.setMnemonic(toClone.getMnemonic());
    clone.setAction(toClone.getAction());
    clone.setAccelerator(toClone.getAccelerator());
    clone.setToolTipText(toClone.getToolTipText());
    ret.add(clone);
   }
   else
   {
    ret.addSeparator();
   }
 }
 return ret;
}

代码示例来源:origin: org.jspresso.framework/jspresso-swing-application

.getKeyText(ks.getKeyCode());
actionItem.setToolTipText(
  "<HTML>" + actionItem.getToolTipText() + " <FONT SIZE=\"-2\" COLOR=\"#993366\">"
    + acceleratorString + "</FONT></HTML>");

代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common

/**
 * Remplace un item menu en provenance de Bu par une action, plus gnraliste.
 * @param _command La commande.
 * @return L'action de remplacement, ou null si la commande n'existait pas.
 */
protected EbliActionAbstract replaceItemByAction(String _command) {
 JMenuItem it=((JMenuItem)getMainMenuBar().getMenuItem(_command));
 if (it==null) return null;
 BuMenu mn=(BuMenu)getMainMenuBar().getMenuForAction(_command);
 if (mn==null) return null;
 int idx=mn.indexOf(_command);
 if (idx==-1) return null;
 EbliActionAbstract act=new EbliActionSimple(it.getText(),it.getIcon(),it.getActionCommand()) {
  public void actionPerformed(ActionEvent _evt) {
   FudaaCommonImplementation.this.actionPerformed(_evt);
  }
 };
 act.setDefaultToolTip(it.getToolTipText());
 act.setKey(it.getAccelerator());
 mn.remove(idx);
 mn.insert(act,idx)
 // Pour rester compatible avec Bu.
  .setName("mi"+_command);
 
 return act;
}

相关文章

JMenuItem类方法