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

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

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

JMenuItem.setVerticalTextPosition介绍

暂无

代码示例

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

@ScriptFunction
@Override
public void setVerticalTextPosition(int aValue) {
  super.setVerticalTextPosition(aValue);
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

/**
 * Factory method which creates the <code>JMenuItem</code> for
 * <code>Actions</code> added to the <code>JPopupMenu</code>.
 *
 * @param a the <code>Action</code> for the menu item to be added
 * @return the new menu item
 * @see Action
 *
 * @since 1.3
 */
protected JMenuItem createActionComponent(Action a, Object ctx) {
  JMenuItem mi = new SafeJMenuItem(ctx, true) {
    protected PropertyChangeListener createActionPropertyChangeListener(Action a) {
      PropertyChangeListener pcl = createActionChangeListener(this);
      if (pcl == null) {
        pcl = super.createActionPropertyChangeListener(a);
      }
      return pcl;
    }
  };
  mi.setHorizontalTextPosition(JButton.TRAILING);
  mi.setVerticalTextPosition(JButton.CENTER);
  return mi;
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

@Override
public JMenuItem insert(Action a, int pos) {
  if(pos < 0) {
    throw new IllegalArgumentException("index less than zero.");
  }
  ensurePopupMenuCreated();
  JMenuItem mi = new JMenuItem(a);
  mi.setHorizontalTextPosition(JButton.TRAILING);
  mi.setVerticalTextPosition(JButton.CENTER);
  popupMenu.insert(mi, pos);
  return mi;
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

/**
 * Appends a component to the end of this menu.
 * Returns the component added.
 *
 * @param c the <code>Component</code> to add
 * @return the <code>Component</code> added
 */
@Override
protected JMenuItem createActionComponent(Action a) {
  JMenuItem mi = new SafeJMenuItem(userObject, true) {
    @Override
    protected PropertyChangeListener createActionPropertyChangeListener(Action a) {
      PropertyChangeListener pcl = createActionChangeListener(this);
      if (pcl == null) {
        pcl = super.createActionPropertyChangeListener(a);
      }
      return pcl;
    }
  };
  mi.setHorizontalTextPosition(SwingConstants.TRAILING);
  mi.setVerticalTextPosition(SwingConstants.CENTER);
  return mi;
}

相关文章

JMenuItem类方法