javax.swing.JLabel.getDisplayedMnemonic()方法的使用及代码示例

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

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

JLabel.getDisplayedMnemonic介绍

暂无

代码示例

代码示例来源:origin: com.google.code.validationframework/validationframework-swing

/**
 * @see AbstractComponentProperty#getPropertyValueFromComponent()
 */
@Override
protected Integer getPropertyValueFromComponent() {
  return component.getDisplayedMnemonic();
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY) {
    int mnemIndex = -1;
    if (JTattooUtilities.getJavaVersion() >= 1.4) {
      mnemIndex = l.getDisplayedMnemonicIndex();
    } else {
      mnemIndex = JTattooUtilities.findDisplayedMnemonicIndex(l.getText(), l.getDisplayedMnemonic());
    }
    g.setColor(Color.black);
    JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX + 1, textY + 1);
    g.setColor(AbstractLookAndFeel.getDisabledForegroundColor());
    JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY) {
    int mnemIndex;
    if (JTattooUtilities.getJavaVersion() >= 1.4) {
      mnemIndex = l.getDisplayedMnemonicIndex();
    } else {
      mnemIndex = JTattooUtilities.findDisplayedMnemonicIndex(l.getText(), l.getDisplayedMnemonic());
    }
    g.setColor(Color.white);
    JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX + 1, textY + 1);
    g.setColor(AbstractLookAndFeel.getDisabledForegroundColor());
    JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
  }
}

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

public int getDisplayedMnemonic()
{
 if((delegate_==this)||(delegate_==null))
  return super.getDisplayedMnemonic();
 return delegate_.getDisplayedMnemonic();
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY) {
  int mnemIndex;
  if (JTattooUtilities.getJavaVersion() >= 1.4) {
    mnemIndex = l.getDisplayedMnemonicIndex();
  } else {
    mnemIndex = JTattooUtilities.findDisplayedMnemonicIndex(l.getText(), l.getDisplayedMnemonic());
  }
  Object sc = l.getClientProperty("shadowColor");
  if (sc instanceof Color) {
    g.setColor((Color)sc);
    JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY + 1);
  }
  g.setColor(l.getForeground());
  JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
}

代码示例来源:origin: xyz.cofe/gui.swing

public int getTabMnemonic() {
  if (isClosed())
    return -1;
  return titleLabel.getDisplayedMnemonic();
}// </editor-fold>

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY) {
  int mnemIndex = -1;
  if (JTattooUtilities.getJavaVersion() >= 1.4) {
    mnemIndex = l.getDisplayedMnemonicIndex();
  } else {
    mnemIndex = JTattooUtilities.findDisplayedMnemonicIndex(l.getText(), l.getDisplayedMnemonic());
  }
  Graphics2D g2D = (Graphics2D) g;
  Composite savedComposite = g2D.getComposite();
  AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f);
  g2D.setComposite(alpha);
  Color fc = l.getForeground();
  if (ColorHelper.getGrayValue(fc) > 164) {
    fc = ColorHelper.brighter(AbstractLookAndFeel.getDisabledForegroundColor(), 40);
    g.setColor(Color.black);
  } else {
    fc = AbstractLookAndFeel.getDisabledForegroundColor();
    g.setColor(Color.white);
  }
  JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY + 1);
  g2D.setComposite(savedComposite);
  g.setColor(fc);
  JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-junit-ui

Component labelFor = lbl.getLabelFor();
if ((labelFor != null) && (labelFor != tfClassToTest)
    && (lbl.getDisplayedMnemonic() != 0)) {
  mnemBlocked.add(lbl);

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY) {
  int mnemIndex = -1;
  if (JTattooUtilities.getJavaVersion() >= 1.4) {
    mnemIndex = l.getDisplayedMnemonicIndex();
  } else {
    mnemIndex = JTattooUtilities.findDisplayedMnemonicIndex(l.getText(), l.getDisplayedMnemonic());
  }
  Color fc = l.getForeground();
  if (AbstractLookAndFeel.getTheme().isTextShadowOn() && ColorHelper.getGrayValue(fc) > 128) {
    g.setColor(Color.black);
    JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX + 1, textY + 1);
  }
  g.setColor(fc);
  JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
}

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

JLabel lb = (JLabel) c;
boolean auto = getAutoMnemonic(lb);
int mn = lb.getDisplayedMnemonic();

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY) {
  int mnemIndex = -1;
  if (JTattooUtilities.getJavaVersion() >= 1.4) {
    mnemIndex = l.getDisplayedMnemonicIndex();
  } else {
    mnemIndex = JTattooUtilities.findDisplayedMnemonicIndex(l.getText(), l.getDisplayedMnemonic());
  }
  Color fc = l.getForeground();
  if (AbstractLookAndFeel.getTheme().isTextShadowOn() && ColorHelper.getGrayValue(fc) > 164) {
    g.setColor(Color.black);
    JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY + 1);
  } else {
    Object sc = l.getClientProperty("shadowColor");
    if (sc instanceof Color) {
      g.setColor((Color)sc);
      JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY + 1);
    }
  }
  g.setColor(fc);
  JTattooUtilities.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
}

代码示例来源:origin: stackoverflow.com

return;
char mnemonic = (char) label.getDisplayedMnemonic();
lai.splitText(text, mnemonic);
List<String> lines = lai.getLines();
  return -1;
char mnemonic = (char) label.getDisplayedMnemonic();
lai.splitText(text, mnemonic);
List<String> lines = lai.getLines();

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-swingapp

javax.swing.JLabel label = new javax.swing.JLabel();
Mnemonics.setLocalizedText(label, text);
int mnem = label.getDisplayedMnemonic();
int mnemIndex = label.getDisplayedMnemonicIndex();
putValue(Action.NAME, label.getText());

相关文章

JLabel类方法