javax.swing.JCheckBox.setForeground()方法的使用及代码示例

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

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

JCheckBox.setForeground介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

cardsOrTokens.setForeground(Color.white);
cardsOrTokens.setToolTipText("Select to show Cards for the chosen set.  When unselected, will show Tokens, Emblems and Planes for the set instead");
cardsOrTokens.addActionListener(e -> mageBook.cardsOrTokens(cardsOrTokens.isSelected()));

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

/**
 * {@inheritDoc}
 */
@Override
public void setForeground(Color fg) {
 super.setForeground(fg);
 unselectedForeground = fg;
}

代码示例来源:origin: igvteam/igv

public void setCheckboxForeground(Color value) {
  if (jCheckBox1 != null) {
    jCheckBox1.setForeground(value);
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

@Override
  public void setForeground(Color fg) {
    if (fg instanceof ColorUIResource) {
      return;
    }
    super.setForeground(fg);
  }
}

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

public void setForeground(Color c) {
  super.setForeground(c);
  unselectedForeground = c;
}

代码示例来源:origin: igvteam/igv

@Override
public void setForeground(Color value) {
  super.setForeground(value);
  if (jCheckBox1 != null) {
    jCheckBox1.setForeground(value);
  }
}

代码示例来源:origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

@Override
public void setForeground(Color fg) {
  super.setForeground(fg);
  getIconLabel().setForeground(fg);
}

代码示例来源:origin: datacleaner/DataCleaner

private JCheckBox createCheckBox(final String label, final boolean selected) {
  final JCheckBox checkBox = new JCheckBox(label, selected);
  checkBox.setOpaque(false);
  checkBox.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);
  checkBox.addItemListener(item -> onSettingsUpdated(false));
  return checkBox;
}

代码示例来源:origin: org.cytoscape/network-merge-impl

public Component getListCellRendererComponent(
        JList list,
        Object value,
        int index,
        boolean isSelected,
        boolean cellHasFocus) {
            if (index > 0) {
                JCheckBox cb = cbs.get(index-1);
                cb.setBackground(isSelected ? Color.blue : Color.white);
                cb.setForeground(isSelected ? Color.white : Color.black);
                return cb;
            }
            Set<String> types = new TreeSet<String>(parent.getSrcTypes().get(net).get(attr));
            return defaultRenderer.getListCellRendererComponent(list, types.toString(), index, isSelected, cellHasFocus);
    }
}

代码示例来源:origin: com.jidesoft/jide-oss

private void clearAttribute() {
  super.setFont(null);
  super.setBackground(null);
  super.setForeground(null);
}

代码示例来源:origin: org.biojava.thirdparty/forester

void setDynamicHidingIsOn( final boolean is_on ) {
  if ( is_on ) {
    getDynamicallyHideData().setForeground( getConfiguration().getGuiCheckboxAndButtonActiveColor() );
  }
  else {
    if ( !_configuration.isUseNativeUI() ) {
      getDynamicallyHideData().setForeground( getConfiguration().getGuiButtonTextColor() );
    }
    else {
      getDynamicallyHideData().setForeground( Color.BLACK );
    }
  }
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

@Override
public void configurarCores() {
  if (WeblafUtils.weblafEstaInstalado()) {
    WeblafUtils.configurarBotao(webButton1, ColorController.FUNDO_CLARO, Color.white, ColorController.COR_DESTAQUE, Color.orange, 15);
    WeblafUtils.configurarBotao(webButton2, ColorController.FUNDO_CLARO, Color.white, ColorController.COR_DESTAQUE, Color.orange, 15);
    WeblafUtils.configurarBotao(webButton3, ColorController.FUNDO_CLARO, ColorController.COR_LETRA, ColorController.COR_DESTAQUE, ColorController.COR_LETRA, 15);
  }
  titleLabel.setBackground(ColorController.FUNDO_ESCURO);
  this.setBackground(ColorController.FUNDO_CLARO);
  descriptionLabel.setForeground(ColorController.COR_LETRA);
  exibirSempre.setForeground(ColorController.COR_LETRA);
}

代码示例来源:origin: abc9070410/JComicDownloader

private JCheckBox getCheckBox( String string, String enString, boolean selected )
{
  string = Common.getStringUsingDefaultLanguage( string, enString ); // 使用預設語言 
  JCheckBox checkBox = new JCheckBox( string, selected );
  checkBox.setFont( SetUp.getDefaultFont() );
  if ( SetUp.getUsingBackgroundPicOfOptionFrame() )
  { // 若設定為透明,就用預定字體。
    checkBox.setForeground( SetUp.getOptionFrameOtherDefaultColor() );
    checkBox.setOpaque( false );
  }
  checkBox.addItemListener( new ItemHandler() );
  return checkBox;
}

代码示例来源:origin: abc9070410/JComicDownloader

private JCheckBox getCheckBoxBold( String string, String enString, boolean selected )
{
  string = Common.getStringUsingDefaultLanguage( string, enString ); // 使用預設語言 
  JCheckBox checkBox = new JCheckBox( string, selected );
  checkBox.setFont( SetUp.getDefaultBoldFont() );
  if ( SetUp.getUsingBackgroundPicOfOptionFrame() )
  { // 若設定為透明,就用預定字體。
    checkBox.setForeground( SetUp.getOptionFrameOtherDefaultColor() );
    checkBox.setOpaque( false );
  }
  checkBox.addItemListener( new ItemHandler() );
  return checkBox;
}

代码示例来源:origin: org.biojava.thirdparty/forester

void addJCheckBox( final JCheckBox jcb, final JPanel p ) {
  jcb.setFocusPainted( false );
  jcb.setFont( ControlPanel.jcb_font );
  if ( !_configuration.isUseNativeUI() ) {
    jcb.setBackground( getConfiguration().getGuiBackgroundColor() );
    jcb.setForeground( getConfiguration().getGuiCheckboxTextColor() );
  }
  p.add( jcb, "Center" );
  jcb.addActionListener( this );
}

代码示例来源:origin: atarw/material-ui-swing

@Override
public void installUI (JComponent c) {
  super.installUI (c);
  JCheckBox checkBox = (JCheckBox) c;
  checkBox.setFont (UIManager.getFont ("CheckBox.font"));
  checkBox.setBackground (UIManager.getColor ("CheckBox.background"));
  checkBox.setForeground (UIManager.getColor ("CheckBox.foreground"));
  checkBox.setIcon (UIManager.getIcon ("CheckBox.icon"));
  checkBox.setSelectedIcon (UIManager.getIcon ("CheckBox.selectedIcon"));
}

代码示例来源:origin: locationtech/jts

public Component getListCellRendererComponent(JList list, Object value,
   int index, boolean isSelected, boolean cellHasFocus) {
  Layer lyr = (Layer) value;
  checkbox.setBackground(isSelected ? getSelectionBackground()
    : getBackground());
  checkbox.setForeground(isSelected ? getSelectionForeground()
    : getForeground());
  checkbox.setSelected(lyr.isEnabled());
  checkbox.setEnabled(isEnabled());
  checkbox.setFont(getFont());
  checkbox.setFocusPainted(false);
  checkbox.setBorderPainted(true);
  checkbox.setBorder(isSelected ? UIManager
    .getBorder("List.focusCellHighlightBorder") : noFocusBorder);
  checkbox.setText(lyr.getNameInfo());
  return checkbox;
 }
}

代码示例来源:origin: net.java.dev.designgridlayout/designgridlayout

private void addGroup(DesignGridLayout layout, String name, List<IHideable> groupRows)
{
  JCheckBox group = new JCheckBox(name);
  group.setName(name);
  group.setForeground(Color.BLUE);
  group.setSelected(true);
  group.addItemListener(new ShowHideAction(groupRows));
  layout.emptyRow();
  layout.row().left().add(group, new JSeparator()).fill();
}

代码示例来源:origin: net.java.dev.designgridlayout/designgridlayout

private void addGroup(DesignGridLayout layout, String name, RowGroup group)
{
  JCheckBox groupBox = new JCheckBox(name);
  groupBox.setName(name);
  groupBox.setForeground(Color.BLUE);
  groupBox.setSelected(true);
  groupBox.addItemListener(new ShowHideAction(group));
  layout.emptyRow();
  layout.row().left().add(groupBox, new JSeparator()).fill();
}

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

public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    JCheckBox checkbox = (JCheckBox) value;
    checkbox.setBackground(isSelected ? getSelectionBackground() : getBackground());
    checkbox.setForeground(isSelected ? getSelectionForeground() : getForeground());
    checkbox.setEnabled(isEnabled());
    checkbox.setFont(getFont());
    checkbox.setFocusPainted(false);
    checkbox.setBorderPainted(false);
    return checkbox;
  }
}

相关文章

JCheckBox类方法