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

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

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

JCheckBox.setHorizontalTextPosition介绍

暂无

代码示例

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

private void initializeComponents(RegularEmitter emitter){
  continuousCheckbox = new JCheckBox("Continuous");
  continuousCheckbox.setSelected(emitter.isContinuous());
  continuousCheckbox.addActionListener(new ActionListener() {
    public void actionPerformed (ActionEvent event) {
      RegularEmitter emitter = (RegularEmitter) editor.getEmitter().emitter;
      emitter.setContinuous(continuousCheckbox.isSelected());
    }
  });
  continuousCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
  
  int i =0;
  addContent(i++, 0, continuousCheckbox, GridBagConstraints.WEST, GridBagConstraints.NONE);
  addContent(i++, 0, countPanel = new CountPanel(editor, "Count", "Min number of particles at all times, max number of particles allowed.", emitter.minParticleCount, emitter.maxParticleCount));
  addContent(i++, 0, delayPanel = new RangedNumericPanel(editor, emitter.getDelay(), "Delay", "Time from beginning of effect to emission start, in milliseconds.", false));
  addContent(i++, 0, durationPanel = new RangedNumericPanel(editor, emitter.getDuration(), "Duration", "Time particles will be emitted, in milliseconds."));
  addContent(i++, 0, emissionPanel = new ScaledNumericPanel(editor, emitter.getEmission(), "Duration", "Emission","Number of particles emitted per second."));
  addContent(i++, 0, lifePanel = new ScaledNumericPanel(editor, emitter.getLife(), "Duration", "Life", "Time particles will live, in milliseconds."));
  addContent(i++, 0, lifeOffsetPanel = new ScaledNumericPanel(editor, emitter.getLifeOffset(), "Duration", "Life Offset","Particle starting life consumed, in milliseconds.", false));
}

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

private void initializeComponents(RegularEmitter emitter){
  continuousCheckbox = new JCheckBox("Continuous");
  continuousCheckbox.setSelected(emitter.isContinuous());
  continuousCheckbox.addActionListener(new ActionListener() {
    public void actionPerformed (ActionEvent event) {
      RegularEmitter emitter = (RegularEmitter) editor.getEmitter().emitter;
      emitter.setContinuous(continuousCheckbox.isSelected());
    }
  });
  continuousCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
  
  int i =0;
  addContent(i++, 0, continuousCheckbox, GridBagConstraints.WEST, GridBagConstraints.NONE);
  addContent(i++, 0, countPanel = new CountPanel(editor, "Count", "Min number of particles at all times, max number of particles allowed.", emitter.minParticleCount, emitter.maxParticleCount));
  addContent(i++, 0, delayPanel = new RangedNumericPanel(editor, emitter.getDelay(), "Delay", "Time from beginning of effect to emission start, in milliseconds.", false));
  addContent(i++, 0, durationPanel = new RangedNumericPanel(editor, emitter.getDuration(), "Duration", "Time particles will be emitted, in milliseconds."));
  addContent(i++, 0, emissionPanel = new ScaledNumericPanel(editor, emitter.getEmission(), "Duration", "Emission","Number of particles emitted per second."));
  addContent(i++, 0, lifePanel = new ScaledNumericPanel(editor, emitter.getLife(), "Duration", "Life", "Time particles will live, in milliseconds."));
  addContent(i++, 0, lifeOffsetPanel = new ScaledNumericPanel(editor, emitter.getLifeOffset(), "Duration", "Life Offset","Particle starting life consumed, in milliseconds.", false));
}

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

EditorPanel.addContent(panel, i, 0, sideLabel = new JLabel("Side"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);		
EditorPanel.addContent(panel, i++, 1, sideCombo = new JComboBox(new DefaultComboBoxModel(SpawnSide.values())), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1, 0);				
edgesCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);

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

EditorPanel.addContent(panel, i, 0, sideLabel = new JLabel("Side"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);		
EditorPanel.addContent(panel, i++, 1, sideCombo = new JComboBox(new DefaultComboBoxModel(SpawnSide.values())), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1, 0);				
edgesCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);

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

chkPennyDreadful.setToolTipText("Will only allow Penny Dreadful legal cards to be shown.");
chkPennyDreadful.setFocusable(false);
chkPennyDreadful.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
chkPennyDreadful.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
chkPennyDreadful.addActionListener(new java.awt.event.ActionListener() {
chkPiles.setToolTipText("Shows the card in piles by the selected sort.");
chkPiles.setFocusable(false);
chkPiles.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
chkPiles.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
chkPiles.addActionListener(new java.awt.event.ActionListener() {
chkNames.setToolTipText("Search in card names.");
chkNames.setFocusable(false);
chkNames.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
chkNames.setMaximumSize(new java.awt.Dimension(67, 16));
chkNames.setMinimumSize(new java.awt.Dimension(67, 16));
chkTypes.setToolTipText("Search in card types.");
chkTypes.setFocusable(false);
chkTypes.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
chkTypes.setMaximumSize(new java.awt.Dimension(63, 16));
chkTypes.setMinimumSize(new java.awt.Dimension(63, 16));
chkRules.setToolTipText("Search in card rules.");
chkRules.setFocusable(false);
chkRules.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
chkRules.setMaximumSize(new java.awt.Dimension(59, 16));
chkRules.setMinimumSize(new java.awt.Dimension(59, 16));

代码示例来源:origin: stackoverflow.com

JCheckBox cb = new JCheckBox("Print with Edge");
cb.setHorizontalTextPosition(SwingConstants.LEADING);

代码示例来源:origin: cmu-phil/tetrad

/**
 * Shows a dialog that allows the user to change the settings for the box's
 * model logger.
 */
private void showLogConfig(final TetradLoggerConfig config) {
  List<TetradLoggerConfig.Event> events = config.getSupportedEvents();
  JPanel panel = new JPanel();
  panel.setLayout(new GridLayout(3, events.size() / 3));
  for (TetradLoggerConfig.Event event : events) {
    final String id = event.getId();
    JCheckBox checkBox = new JCheckBox(event.getDescription());
    checkBox.setHorizontalTextPosition(AbstractButton.RIGHT);
    checkBox.setSelected(config.isEventActive(id));
    checkBox.addActionListener((e) -> {
      JCheckBox box = (JCheckBox) e.getSource();
      config.setEventActive(id, box.isSelected());
    });
    panel.add(checkBox);
  }
  panel.setBorder(new TitledBorder("Select Events to Log"));
  // how show the dialog
  JOptionPane.showMessageDialog(this, panel, "Edit Events to Log", JOptionPane.PLAIN_MESSAGE);
}

代码示例来源:origin: cmu-phil/tetrad

/**
 * Builds the output selection boxes.
 */
private static Box createLogToBox() {
  Box box = Box.createHorizontalBox();
  box.add(new JLabel("Log output to: "));
  box.add(Box.createHorizontalStrut(5));
  JCheckBox fileCheckBox = new JCheckBox(" File ");
  fileCheckBox.setSelected(TetradLogger.getInstance().isFileLoggingEnabled());
  fileCheckBox.setHorizontalTextPosition(AbstractButton.LEFT);
  fileCheckBox.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      JCheckBox box = (JCheckBox) e.getSource();
      TetradLogger.getInstance().setFileLoggingEnabled(box.isSelected());
    }
  });
  JCheckBox textareaCheckBox = new JCheckBox(" Log Display ");
  textareaCheckBox.setSelected(TetradLogger.getInstance().isDisplayLogEnabled());
  textareaCheckBox.setHorizontalTextPosition(AbstractButton.LEFT);
  textareaCheckBox.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      JCheckBox box = (JCheckBox) e.getSource();
      TetradLogger.getInstance().setDisplayLogEnabled(box.isSelected());
    }
  });
  box.add(fileCheckBox);
  box.add(textareaCheckBox);
  box.add(Box.createHorizontalGlue());
  return box;
}

代码示例来源:origin: org.gephi/datalab-plugin

replaceColumnCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
replaceColumnCheckbox.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {

代码示例来源:origin: cmu-phil/tetrad

/**
 * Builds the output selection boxes.
 */
private static Box createLogToBox() {
  Box box = Box.createHorizontalBox();
  box.add(new JLabel("Log output to: "));
  box.add(Box.createHorizontalStrut(5));
  JCheckBox fileCheckBox = new JCheckBox(" File ");
  fileCheckBox.setSelected(TetradLogger.getInstance().isFileLoggingEnabled());
  fileCheckBox.setHorizontalTextPosition(AbstractButton.LEFT);
  fileCheckBox.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      JCheckBox box = (JCheckBox) e.getSource();
      TetradLogger.getInstance().setFileLoggingEnabled(box.isSelected());
    }
  });
  JCheckBox textareaCheckBox = new JCheckBox(" Log Display ");
  textareaCheckBox.setSelected(TetradLogger.getInstance().isDisplayLogEnabled());
  textareaCheckBox.setHorizontalTextPosition(AbstractButton.LEFT);
  textareaCheckBox.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      JCheckBox box = (JCheckBox) e.getSource();
      TetradLogger.getInstance().setDisplayLogEnabled(box.isSelected());
    }
  });
  box.add(fileCheckBox);
  box.add(textareaCheckBox);
  box.add(Box.createHorizontalGlue());
  return box;
}

代码示例来源:origin: stackoverflow.com

check.setHorizontalTextPosition(SwingConstants.LEFT);

代码示例来源:origin: cmu-phil/tetrad

private boolean globalChangeVerification() {
  if (!Preferences.userRoot().getBoolean("ignoreGlobalDiscretizationWarning", false)) {
    Box box = Box.createVerticalBox();
    String message = "<html>This action will change the number of categories for all selected variables<br>" +
        "and override any previous work. Are you sure you want continue?</html>";
    box.add(new JLabel(message));
    box.add(Box.createVerticalStrut(5));
    JCheckBox checkBox = new JCheckBox("Don't show this again");
    checkBox.setHorizontalTextPosition(AbstractButton.LEFT);
    checkBox.setHorizontalAlignment(AbstractButton.RIGHT);
    checkBox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        JCheckBox box = (JCheckBox) e.getSource();
        Preferences.userRoot().putBoolean("ignoreGlobalDiscretizationWarning", box.isSelected());
      }
    });
    box.add(checkBox);
    box.add(Box.createVerticalStrut(5));
    int option = JOptionPane.showConfirmDialog(this, box, "Discretization Warning", JOptionPane.YES_NO_OPTION);
    return JOptionPane.YES_OPTION == option;
  }
  return true;
}

代码示例来源:origin: cmu-phil/tetrad

/**
 * Shows the log display setup dialog.
 */
private void showLogSetupDialog() {
  JPanel panel = new JPanel();
  List<TetradLoggerConfig.Event> events = config.getSupportedEvents();
  panel.setLayout(new GridLayout(3, events.size() / 3));
  for (TetradLoggerConfig.Event event : events) {
    final String id = event.getId();
    JCheckBox checkBox = new JCheckBox(event.getDescription());
    checkBox.setHorizontalTextPosition(AbstractButton.RIGHT);
    checkBox.setSelected(config.isEventActive(id));
    checkBox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        JCheckBox box = (JCheckBox) e.getSource();
        config.setEventActive(id, box.isSelected());
      }
    });
    panel.add(checkBox);
  }
  panel.setBorder(new TitledBorder("Select Events to Log"));
  Component comp = parent == null ? JOptionUtils.centeringComp() : parent;
  JOptionPane.showMessageDialog(comp, panel, "Logging Setup", JOptionPane.PLAIN_MESSAGE);
}

代码示例来源:origin: org.gephi/visualization

showPropertiesCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
showPropertiesCheckbox.setMargin(new java.awt.Insets(2, 2, 2, 0));

代码示例来源:origin: org.gephi/visualization

hightlightCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
hightlightCheckBox.setMargin(new java.awt.Insets(2, 0, 2, 2));
autoSelectNeigborCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
autoSelectNeigborCheckbox.setMargin(new java.awt.Insets(2, 0, 2, 2));

代码示例来源:origin: JGillam/burp-co2

settingsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.black), "Unusual Intruder Payloads"));
useDelimiterCheckBox = new JCheckBox();
useDelimiterCheckBox.setHorizontalTextPosition(10);
useDelimiterCheckBox.setText("Use Delimiter:");
settingsPanel.add(useDelimiterCheckBox, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));

代码示例来源:origin: org.fudaa.soft.fudaa-refonde/refonde-client

cbZPt.setHorizontalTextPosition(SwingConstants.LEFT);
cbZPt.setText("Automatique :");
tfXPt.setColumns(12);

代码示例来源:origin: cmu-phil/tetrad

latentVarsBox.setHorizontalTextPosition(SwingConstants.LEFT);
latentVarsBox.addActionListener(new ActionListener(){
  public void actionPerformed(ActionEvent e) {

代码示例来源:origin: com.badlogicgames.gdx/gdx-tools

private void initializeComponents(RegularEmitter emitter){
  continuousCheckbox = new JCheckBox("Continuous");
  continuousCheckbox.setSelected(emitter.isContinuous());
  continuousCheckbox.addActionListener(new ActionListener() {
    public void actionPerformed (ActionEvent event) {
      RegularEmitter emitter = (RegularEmitter) editor.getEmitter().emitter;
      emitter.setContinuous(continuousCheckbox.isSelected());
    }
  });
  continuousCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
  
  int i =0;
  addContent(i++, 0, continuousCheckbox, GridBagConstraints.WEST, GridBagConstraints.NONE);
  addContent(i++, 0, countPanel = new CountPanel(editor, "Count", "Min number of particles at all times, max number of particles allowed.", emitter.minParticleCount, emitter.maxParticleCount));
  addContent(i++, 0, delayPanel = new RangedNumericPanel(editor, emitter.getDelay(), "Delay", "Time from beginning of effect to emission start, in milliseconds.", false));
  addContent(i++, 0, durationPanel = new RangedNumericPanel(editor, emitter.getDuration(), "Duration", "Time particles will be emitted, in milliseconds."));
  addContent(i++, 0, emissionPanel = new ScaledNumericPanel(editor, emitter.getEmission(), "Duration", "Emission","Number of particles emitted per second."));
  addContent(i++, 0, lifePanel = new ScaledNumericPanel(editor, emitter.getLife(), "Duration", "Life", "Time particles will live, in milliseconds."));
  addContent(i++, 0, lifeOffsetPanel = new ScaledNumericPanel(editor, emitter.getLifeOffset(), "Duration", "Life Offset","Particle starting life consumed, in milliseconds.", false));
}

相关文章

JCheckBox类方法