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

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

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

JCheckBox.setFocusPainted介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

radioCustomFromRow.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
radioCustomFromRow.setIcon(new CheckBoxMenuItemIconCustom());
radioCustomFromRow.setFocusPainted(false);
radioCustomToRow.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
radioCustomToRow.setIcon(new CheckBoxMenuItemIconCustom());
radioCustomToRow.setFocusPainted(false);
radioCustomFromChar.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
radioCustomFromChar.setIcon(new CheckBoxMenuItemIconCustom());
radioCustomFromChar.setFocusPainted(false);
radioCustomToChar.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
radioCustomToChar.setIcon(new CheckBoxMenuItemIconCustom());
radioCustomToChar.setFocusPainted(false);

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

public void setFocusPainted(boolean value) {
  if (jCheckBox1 != null) {
    jCheckBox1.setFocusPainted(value);
  }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

private void setFocusPainted(boolean focusPainted) {
 checkBox.setFocusPainted(focusPainted);
}

代码示例来源:origin: Exslims/MercuryTrade

public JCheckBox getCheckBox(boolean value) {
    JCheckBox checkBox = new JCheckBox();
    checkBox.setSelected(value);
//        checkBox.setUI(new WindowsButtonUI());
    checkBox.setFocusPainted(false);
    checkBox.setBackground(AppThemeColor.TRANSPARENT);
    return checkBox;
  }

代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing

public CheckBoxNodeRenderer() {
  Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  leafRenderer.setFocusPainted((booleanValue != null)
      && (booleanValue));
  leafRenderer.addActionListener(new CheckBoxNodeActionListener());
  selectionForeground = UIManager.getColor("Tree.selectionForeground");
  selectionBackground = UIManager.getColor("Tree.selectionBackground");
  textForeground = UIManager.getColor("Tree.textForeground");
  textBackground = UIManager.getColor("Tree.textBackground");
}

代码示例来源:origin: org.scijava/swing-checkbox-tree

public CheckBoxNodeRenderer() {
  final Font fontValue = UIManager.getFont("Tree.font");
  if (fontValue != null) panel.label.setFont(fontValue);
  final Boolean focusPainted =
    (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  panel.check.setFocusPainted(focusPainted != null && focusPainted);
  selectionForeground = UIManager.getColor("Tree.selectionForeground");
  selectionBackground = UIManager.getColor("Tree.selectionBackground");
  textForeground = UIManager.getColor("Tree.textForeground");
  textBackground = UIManager.getColor("Tree.textBackground");
}

代码示例来源:origin: GoldenGnu/jeveassets

public CheckBoxNodeRenderer() {
  Font fontValue;
  fontValue = UIManager.getFont("Tree.font");
  if (fontValue != null) {
    leafRenderer.setFont(fontValue);
  }
  Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  leafRenderer.setFocusPainted(booleanValue != null && booleanValue);
  selectionBorderColor = UIManager.getColor("Tree.selectionBorderColor");
  selectionForeground = UIManager.getColor("Tree.selectionForeground");
  selectionBackground = UIManager.getColor("Tree.selectionBackground");
  textForeground = UIManager.getColor("Tree.textForeground");
  textBackground = UIManager.getColor("Tree.textBackground");
}

代码示例来源:origin: com.jalalkiswani/jk-desktop

/**
 * Instantiates a new tree check box node renderer.
 */
// ///////////////////////////////////////////////////////////////////////////////////////
public TreeCheckBoxNodeRenderer() {
  Font fontValue;
  fontValue = UIManager.getFont("Tree.font");
  if (fontValue != null) {
    this.leafRenderer.setFont(fontValue);
  }
  final Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  this.leafRenderer.setFocusPainted(booleanValue != null && booleanValue.booleanValue());
  this.selectionBorderColor = UIManager.getColor("Tree.selectionBorderColor");
  this.selectionForeground = UIManager.getColor("Tree.selectionForeground");
  this.selectionBackground = UIManager.getColor("Tree.selectionBackground");
  this.textForeground = UIManager.getColor("Tree.textForeground");
  this.textBackground = UIManager.getColor("Tree.textBackground");
}

代码示例来源:origin: gurkenlabs/litiengine

public CheckBoxPanel(String text) {
 this.newCheck = new JCheckBox();
 this.newLabel = new JLabel(text);
 this.newCheck.setFocusPainted(false);
 this.newCheck.setBorderPainted(true);
 this.newLabel.setOpaque(true);
 this.newLabel.setFocusable(false);
 this.setLayout(new BorderLayout());
 this.add(newCheck, BorderLayout.WEST);
 this.add(newLabel, BorderLayout.CENTER);
}

代码示例来源:origin: Exslims/MercuryTrade

public JCheckBox getCheckBox(String tooltip) {
    JCheckBox checkBox = new JCheckBox();
    checkBox.setFocusPainted(false);
    checkBox.setBackground(AppThemeColor.TRANSPARENT);
//        checkBox.setUI(new WindowsButtonUI());
    checkBox.addMouseListener(new TooltipMouseListener(tooltip));
    return checkBox;
  }

代码示例来源:origin: robward-scisys/sldeditor

/** Instantiates a new check box panel. */
public CheckBoxPanel() {
  setOpaque(false);
  checkBox = new JCheckBox();
  checkBox.setMargin(new Insets(0, 0, 0, 0));
  label = new TreeLabel();
  setLayout(new BorderLayout());
  add(checkBox, BorderLayout.WEST);
  Border border = label.getBorder();
  Border margin = new EmptyBorder(0, 3, 0, 0);
  label.setBorder(new CompoundBorder(border, margin));
  add(label, BorderLayout.CENTER);
  Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  checkBox.setFocusPainted((booleanValue != null) && (booleanValue.booleanValue()));
  selectionForeground = UIManager.getColor("Tree.selectionForeground");
  textForeground = UIManager.getColor("Tree.textForeground");
}

代码示例来源:origin: aterai/java-swing-tips

check.setFocusPainted(false);

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

JCheckBox cbx = new JCheckBox("Don't show this message again (can be undone in Preferences)");
cbx.setSelected(cbxSelected);
cbx.setFocusPainted(false);
JOptionPane optPane = new JOptionPaneWithCheckbox(cbx, message.text,JOptionPane.INFORMATION_MESSAGE, optionType);
optPane.addPropertyChangeListener(new PropertyChangeListener()

代码示例来源: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: tulskiy/musique

singleInstance.setFocusPainted(false);
singleInstance.setMargin(new java.awt.Insets(2, -1, 2, 2));
enableTray.setFocusPainted(false);
minimizeOnClose.setFocusPainted(false);
showSideBar.setFocusPainted(false);
searchLyrics.setFocusPainted(false);

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

usePreverify.setFocusPainted(false);
usePreverify.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {

代码示例来源: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.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;
  }
}

代码示例来源:origin: gurkenlabs/litiengine

@Override
public Component getListCellRendererComponent(JList<? extends JCheckBox> list, JCheckBox value, int index, boolean isSelected, boolean cellHasFocus) {
 if(!this.panels.containsKey(value)) {
  this.panels.put(value, new CheckBoxPanel(value.getText()));
 }
 
 CheckBoxPanel panel = this.panels.get(value);
 panel.getCheck().setSelected(value.isSelected());
 // Drawing checkbox, change the appearance here
 panel.getCheck().setBackground(isSelected ? getSelectionBackground() : getBackground());
 panel.getCheck().setForeground(isSelected ? getSelectionForeground() : getForeground());
 panel.getCheck().setEnabled(isEnabled());
 panel.getCheck().setFont(getFont());
 panel.getCheck().setFocusPainted(false);
 panel.getCheck().setBorderPainted(true);
 panel.getCheck().setBorder(isSelected ? UIManager.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
 panel.getLabel().setOpaque(true);
 panel.getLabel().setBackground(isSelected ? getSelectionBackground() : getBackground());
 panel.getLabel().setForeground(isSelected ? getSelectionForeground() : getForeground());
 panel.getLabel().setEnabled(isEnabled());
 panel.getLabel().setFocusable(false);
 panel.getLabel().setFont(getFont());
 panel.getLabel().setBorder(isSelected ? UIManager.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
 panel.getLabel().setIcon(value.getIcon());
 return panel;
}

相关文章

JCheckBox类方法