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

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

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

JCheckBox.setHorizontalAlignment介绍

暂无

代码示例

代码示例来源:origin: RipMeApp/ripme

private static JCheckBox addNewCheckbox(String text, String configString, Boolean configBool) {
  JCheckBox checkbox = new JCheckBox(text, Utils.getConfigBoolean(configString, configBool));
  checkbox.setHorizontalAlignment(JCheckBox.RIGHT);
  checkbox.setHorizontalTextPosition(JCheckBox.LEFT);
  return checkbox;
}

代码示例来源:origin: kiegroup/optaplanner

public CheapTimePanel() {
  setLayout(new BorderLayout());
  groupByMachineCheckBox = new JCheckBox("Group by assigned machine", false);
  groupByMachineCheckBox.setHorizontalAlignment(SwingConstants.RIGHT);
  groupByMachineCheckBox.addActionListener(e -> {
    updatePanel(getSolution());
    validate();
  });
}

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

chkPiles.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
chkPiles.setMargin(new java.awt.Insets(3, 2, 2, 2));
chkPiles.addActionListener(evt -> chkPilesActionPerformed(evt));

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

private static JCheckBox createJCheckBox() {
    JCheckBox jCheckBox = new JCheckBox();
    jCheckBox.setHorizontalAlignment(JLabel.CENTER);
    return jCheckBox;
  }
}

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

showPlayerNamesPermanently.setText("Show player names on avatar permanently");
showPlayerNamesPermanently.setToolTipText("Instead showing the names only if you hover over the avatar with the mouse, the name is shown all the time.");
showPlayerNamesPermanently.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
showPlayerNamesPermanently.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
displayLifeOnAvatar.setText("Display life on avatar image");
displayLifeOnAvatar.setToolTipText("Display the player's life over its avatar image.");
displayLifeOnAvatar.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
displayLifeOnAvatar.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
showAbilityPickerForced.setText("Show ability picker for abilities or spells without costs");
showAbilityPickerForced.setToolTipText("This prevents you from accidently activating abilities without other costs than tapping or casting spells with 0 mana costs.");
showAbilityPickerForced.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
showAbilityPickerForced.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
cbAllowRequestToShowHandCards.setText("Allow requests from players and spectators to show your hand cards");
cbAllowRequestToShowHandCards.setToolTipText("<html>This is the default setting used for your matches. If activated other players or spectators<br>\nof your match can send a request so you can allow them to see your hand cards.");
cbAllowRequestToShowHandCards.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
cbAllowRequestToShowHandCards.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
cbShowStormCounter.setText("Show the number of spell casts during the current turn");
cbShowStormCounter.setToolTipText("<html>Adds a little box left to the short keys line with the number<br>\nof spells already cast during the current turn (storm counter).");
cbShowStormCounter.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
cbShowStormCounter.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {

代码示例来源:origin: senbox-org/snap-desktop

private static JCheckBox createCeckbox(final JPanel panel, boolean enabled) {
  JCheckBox checkBox = new JCheckBox();
  checkBox.setHorizontalAlignment(SwingConstants.CENTER);
  checkBox.setEnabled(enabled);
  panel.add(checkBox);
  return checkBox;
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

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

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

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

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

@Override
  public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    JCheckBox checkbox = (JCheckBox) editorComponent;
    checkbox.setSelected(value == null ? false : (Boolean) value);
    checkbox.setHorizontalAlignment(SwingConstants.LEFT);
    return super.getTableCellEditorComponent(table, value, isSelected, row, column);
  }
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

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

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-runtime

public BooleanCellRenderer(TableCellRenderer delegate, JCheckBox checkBox, Predicate<?> predicate) {
  this.defaultDelegate = delegate;
  this.predicate = predicate;
  this.checkBox = checkBox;
  this.checkBox.setBorderPainted(true);
  this.checkBox.setHorizontalAlignment(JLabel.CENTER);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-webui-designtime

public SelectedCellEditor( JCheckBox selectValuesCheckBox, JCheckBox multipleChoiceCheckBox ) {
  this.selectValuesCheckBox = selectValuesCheckBox;
  this.multipleChoiceCheckBox = multipleChoiceCheckBox;  
  
  radioBtn = new JRadioButton();
  checkbox = new JCheckBox();
  radioBtn.setHorizontalAlignment( JRadioButton.CENTER );
  checkbox.setHorizontalAlignment(JCheckBox.CENTER);
  
  radioBtn.addActionListener( (ActionListener)this );
  checkbox.addActionListener( (ActionListener)this );
  
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing

public BooleanCellRenderer(TableCellRenderer delegate) {
  //super(new BorderLayout());
  this.checkBox = new JCheckBox();
  add(checkBox, BorderLayout.CENTER);
  checkBox.setHorizontalAlignment(JLabel.CENTER);
  checkBox.setBorderPainted(true);
  this.defaultDelegate = delegate;
}

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

/** Creates a new instance of BooleanTableCellRenderer */
public BooleanTableCellRenderer() {
  super();
  super.setLayout(new BorderLayout(0, 0));
  checkBox = new JCheckBox();
  checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  checkBox.setOpaque(false);
  add(checkBox, BorderLayout.CENTER);
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime

@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  JComponent rendered = (JComponent) rendererDelegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
  if (rendered instanceof JCheckBox) {
    JCheckBox checkBox = (JCheckBox)rendered;
    checkBox.setHorizontalAlignment(JLabel.CENTER);
    checkBox.setVerticalTextPosition(JLabel.TOP);
    checkBox.setBorderPainted(true);
    checkBox.setIcon(icon);
  }
  return rendered;
}

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

private CheckBoxTableCellEditor() {
  super(new JCheckBox());
((JCheckBox)getEditorComponent()).setHorizontalAlignment(JLabel.CENTER);
  ((JCheckBox)getEditorComponent()).setBorderPainted(true);
}

代码示例来源: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: org.nuiton.jaxx/jaxx-runtime-swing

public BooleanCellRenderer(TableCellRenderer delegate, Icon icon) {
  //super(new BorderLayout());
  this.checkBox = new JCheckBox(icon);
  add(checkBox, BorderLayout.NORTH);
  checkBox.setHorizontalAlignment(JLabel.CENTER);
  checkBox.setVerticalTextPosition(JLabel.TOP);
  checkBox.setBorderPainted(true);
  this.defaultDelegate = delegate;
}

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

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

代码示例来源:origin: org.codehaus.izpack/izpack-panel

CheckBoxRenderer()
{
  if (com.izforge.izpack.util.OsVersion.IS_UNIX && !com.izforge.izpack.util.OsVersion.IS_OSX)
  {
    checkbox.setIcon(new LFIndependentIcon());
    checkbox.setDisabledIcon(new LFIndependentIcon());
    checkbox.setSelectedIcon(new LFIndependentIcon());
    checkbox.setDisabledSelectedIcon(new LFIndependentIcon());
  }
  checkbox.setHorizontalAlignment(CENTER);
}

相关文章

JCheckBox类方法