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

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

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

JCheckBox.setOpaque介绍

暂无

代码示例

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

public CategoryNodeRenderer() {
 _panel.setBackground(UIManager.getColor("Tree.textBackground"));
 if (_sat == null) {
  // Load the satellite image.
  String resource =
    "/org/apache/log4j/lf5/viewer/images/channelexplorer_satellite.gif";
  URL satURL = getClass().getResource(resource);
  _sat = new ImageIcon(satURL);
 }
 setOpaque(false);
 _checkBox.setOpaque(false);
 _panel.setOpaque(false);
 // The flowlayout set to LEFT is very important so that the editor
 // doesn't jump around.
 _panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
 _panel.add(_checkBox);
 _panel.add(this);
 setOpenIcon(_sat);
 setClosedIcon(_sat);
 setLeafIcon(_sat);
}

代码示例来源:origin: stanfordnlp/CoreNLP

public FileTreeNode(File file, FileTreeNode parent) {
 super(file);
 this.setParent(parent);
 this.file = file;
 boolean isLeaf = file.isFile();
 if(isLeaf) {
  check = new JCheckBox(this.toString(),isLeaf);
  check.setOpaque(true);
  check.setBackground(Color.WHITE);
 }
 else
  label = new JLabel(this.toString());
 this.setAllowsChildren(!isLeaf);
}

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

@Override
public void setOpaque(boolean isOpaque) {
  if (!isOpaque) {
    super.setOpaque(isOpaque);
  }
}

代码示例来源:origin: otros-systems/otroslogviewer

public MarkTableRenderer() {
 super();
 checkBox = new JCheckBox();
 checkBox.setOpaque(true);
}

代码示例来源:origin: danfickle/openhtmltopdf

public JComponent create() {
  JCheckBox checkbox = new JCheckBox();
  checkbox.setText("");
  checkbox.setOpaque(false);
  return checkbox;
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public JComponent create() {
  JCheckBox checkbox = new JCheckBox();
  checkbox.setText("");
  checkbox.setOpaque(false);
  return checkbox;
}

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

public CheckCellEditor() {
  super();
  check = new JCheckBox();
  add(check, BorderLayout.CENTER);
  check.setOpaque(false);
  check.addActionListener(this);
}

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

public CheckCellRenderer() {
  super();
  check = new JCheckBox();
  add(check, BorderLayout.CENTER);
  check.setOpaque(false);
}

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

public void updateUI() {
    super.updateUI();
    if (m_panel != null) {
      m_panel.setBackground(javax.swing.UIManager.getColor("TextField.background"));
      m_cbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 4, 2, 2));
      m_cbox.setOpaque(false);
    }
  }
};

代码示例来源: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.netbeans.modules/org-netbeans-modules-cnd

private void addEntity(NamedOption ne) {
  JCheckBox cb = new JCheckBox();
  Mnemonics.setLocalizedText(cb, ne.getDisplayName());
  if (ne.getDescription() != null) {
    cb.setToolTipText(ne.getDescription());
  }
  cb.setOpaque(false);
  entities.add(new Entity(ne, cb));
  cb.addActionListener(this);
}

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

public CheckBoxTreeRenderer() {
  setLayout(new BorderLayout());
  setOpaque(true);
  this.check = new JCheckBox();
  this.label = new JLabel();
  add(check, BorderLayout.WEST);
  add(label, BorderLayout.CENTER);
  check.setOpaque(false);
  label.setOpaque(false);
}

代码示例来源:origin: org.japura/japura-gui

protected JCheckBox getCheckBox() {
 if (checkBox == null) {
  checkBox =
    new JCheckBox(I18nAdapter.getAdapter().getString(
      GUIStringKeys.SELECT_DESELECT_ALL.getKey()));
  checkBox.setOpaque(false);
 }
 return checkBox;
}

代码示例来源:origin: org.rwshop/org.rwshop.swing.common

private static void makeCellCheckBox(JCheckBox cb, Icon icon, Icon selIcon, String tooltip){
  cb.setHorizontalAlignment(JCheckBox.CENTER);
  if(icon != null){
    cb.setIcon(icon);
  }
  if(selIcon != null){
    cb.setSelectedIcon(selIcon);
  }
  cb.setOpaque(true);
  cb.setToolTipText(tooltip);
}

代码示例来源:origin: digital-preservation/droid

@Override
public Component getTableCellEditorComponent(JTable table, Object value, 
    boolean isSelected, int row, int column) {
  profile = (ProfileWrapper) value;
  
  final JCheckBox checkBox = (JCheckBox) getComponent();
  
  checkBox.setText(profile.getProfile().getName());
  checkBox.setSelected(profile.isSelected());
  checkBox.setOpaque(false);
  
  return checkBox;
}

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

@Override
public Component getTableCellEditorComponent(JTable table, Object value, 
    boolean isSelected, int row, int column) {
  profile = (ProfileWrapper) value;
  
  final JCheckBox checkBox = (JCheckBox) getComponent();
  
  checkBox.setText(profile.getProfile().getName());
  checkBox.setSelected(profile.isSelected());
  checkBox.setOpaque(false);
  
  return checkBox;
}

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

public CheckTreeCellRenderer() {
  setLayout(new BorderLayout());
  setOpaque(false);
  checkBox.setOpaque(false);
  // --- Workaround for #205932 - not sure why, but works fine...
  Font f = UIManager.getFont("Label.font"); // NOI18N
  if (f != null) treeRenderer.setFont(f.deriveFont(f.getStyle()));
  // --- 
  add(checkBox, BorderLayout.WEST);
}

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

private CheckBoxRenderer() {
 super(new FlowLayout(FlowLayout.CENTER, 0, 0));
 add(checkBox = new JCheckBox());
 add(label = new JLabel());
 label.setIconTextGap(1);
 checkBox.setOpaque(false);
 checkBox.setMargin(new Insets(0, 0, 0, 0));
 setOpaque(false);
 setEnabled(true);
 setBorder(null);
}

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

public BooleanEditor() {
    super(new SubstanceEditorCheckBox());
    JCheckBox checkBox = (JCheckBox) getComponent();
    checkBox.setOpaque(false);
    checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  }
}

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

public BooleanEditor() {
    super(new SubstanceEditorCheckBox());
    JCheckBox checkBox = (JCheckBox) getComponent();
    checkBox.setOpaque(false);
    checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  }
}

相关文章

JCheckBox类方法