javax.swing.JComboBox.hasFocus()方法的使用及代码示例

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

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

JComboBox.hasFocus介绍

暂无

代码示例

代码示例来源:origin: omegat-org/omegat

private JComboBox<String> getActiveField() {
  return form.m_replaceField.hasFocus() ? form.m_replaceField : form.m_searchField;
}

代码示例来源:origin: pentaho/pentaho-reporting

/**
 * Return the component that should be added to the tree hierarchy for this editor
 */
public Component getEditorComponent() {
 final Component listCellRendererComponent = renderer.getListCellRendererComponent
  ( new JList(), comboBox.getSelectedItem(), comboBox.getSelectedIndex(), false, comboBox.hasFocus() );
 if ( listCellRendererComponent instanceof JComponent ) {
  final JComponent jc = (JComponent) listCellRendererComponent;
  jc.setBorder( new LineBorder( Color.BLACK ) );
 }
 return listCellRendererComponent;
}

代码示例来源:origin: com.github.arnabk/pgslookandfeel

public void paint(Graphics g, JComponent c) {
  hasFocus = comboBox.hasFocus();
  if (comboBox.isEditable()) {
    Color old = g.getColor();
    g.setColor(UIManager.getColor("TextField.background"));
    g.fillRect(0, 0, c.getWidth()+1, c.getHeight()+1);
    g.setColor(old);
  } else {
    Rectangle r = rectangleForCurrentValue();
    paintCurrentValueBackground(g, r, hasFocus);
    paintCurrentValue(g, r, hasFocus);
  }
}

代码示例来源:origin: de.dfki.mary/marytts-client

private void verifyEnableButtons() {
  if (((MaryClient.DataType) cbOutputType.getSelectedItem()).isTextType()) {
    buttonPanel.setVisible(true);
    if (!cbOutputType.hasFocus())
      bProcess.requestFocusInWindow();
  } else { // do not show these three buttons for audio output:
    buttonPanel.setVisible(false);
    if (!cbOutputType.hasFocus())
      bPlay.requestFocusInWindow();

代码示例来源:origin: khuxtable/seaglass

protected void paint(SeaGlassContext context, Graphics g) {
  hasFocus = comboBox.hasFocus();
  if (!comboBox.isEditable()) {
    Rectangle r = rectangleForCurrentValue();
    paintCurrentValue(g, r, hasFocus);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

public void paint(Graphics g, JComponent c)
{
  hasFocus= comboBox.hasFocus();
  if (!comboBox.isEditable())
  {
    Rectangle r= rectangleForCurrentValue();
    paintCurrentValueBackground(g, r, hasFocus);
    paintCurrentValue(g, r, hasFocus);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

/**
 * Description of the Method
 *
 * @param g  Description of Parameter
 * @param c  Description of Parameter
 */
public void paint(Graphics g, JComponent c) {
 hasFocus = comboBox.hasFocus();
 Rectangle r = rectangleForCurrentValue();
 skin.getPersonality().paintComboBox(g, comboBox, r, hasFocus, rollover);
 if (!comboBox.isEditable() || editor == null || !editor.isVisible()) {
  paintCurrentValue(g, r, false);
 }
}

代码示例来源:origin: org.java.net.substance/substance

hasFocus = comboBox.hasFocus();
if (!comboBox.isEditable()) {
  Rectangle r = rectangleForCurrentValue();

代码示例来源:origin: com.github.insubstantial/substance

hasFocus = comboBox.hasFocus();
if (!comboBox.isEditable()) {
  Rectangle r = rectangleForCurrentValue();

相关文章

JComboBox类方法