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

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

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

JCheckBox.setHorizontalAlignment介绍

暂无

代码示例

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

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

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

  1. public CheapTimePanel() {
  2. setLayout(new BorderLayout());
  3. groupByMachineCheckBox = new JCheckBox("Group by assigned machine", false);
  4. groupByMachineCheckBox.setHorizontalAlignment(SwingConstants.RIGHT);
  5. groupByMachineCheckBox.addActionListener(e -> {
  6. updatePanel(getSolution());
  7. validate();
  8. });
  9. }

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

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

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

  1. private static JCheckBox createJCheckBox() {
  2. JCheckBox jCheckBox = new JCheckBox();
  3. jCheckBox.setHorizontalAlignment(JLabel.CENTER);
  4. return jCheckBox;
  5. }
  6. }

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

  1. showPlayerNamesPermanently.setText("Show player names on avatar permanently");
  2. showPlayerNamesPermanently.setToolTipText("Instead showing the names only if you hover over the avatar with the mouse, the name is shown all the time.");
  3. showPlayerNamesPermanently.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
  4. showPlayerNamesPermanently.addActionListener(new java.awt.event.ActionListener() {
  5. public void actionPerformed(java.awt.event.ActionEvent evt) {
  6. displayLifeOnAvatar.setText("Display life on avatar image");
  7. displayLifeOnAvatar.setToolTipText("Display the player's life over its avatar image.");
  8. displayLifeOnAvatar.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
  9. displayLifeOnAvatar.addActionListener(new java.awt.event.ActionListener() {
  10. public void actionPerformed(java.awt.event.ActionEvent evt) {
  11. showAbilityPickerForced.setText("Show ability picker for abilities or spells without costs");
  12. showAbilityPickerForced.setToolTipText("This prevents you from accidently activating abilities without other costs than tapping or casting spells with 0 mana costs.");
  13. showAbilityPickerForced.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
  14. showAbilityPickerForced.addActionListener(new java.awt.event.ActionListener() {
  15. public void actionPerformed(java.awt.event.ActionEvent evt) {
  16. cbAllowRequestToShowHandCards.setText("Allow requests from players and spectators to show your hand cards");
  17. 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.");
  18. cbAllowRequestToShowHandCards.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
  19. cbAllowRequestToShowHandCards.addActionListener(new java.awt.event.ActionListener() {
  20. public void actionPerformed(java.awt.event.ActionEvent evt) {
  21. cbShowStormCounter.setText("Show the number of spell casts during the current turn");
  22. 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).");
  23. cbShowStormCounter.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
  24. cbShowStormCounter.addActionListener(new java.awt.event.ActionListener() {
  25. public void actionPerformed(java.awt.event.ActionEvent evt) {

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

  1. private static JCheckBox createCeckbox(final JPanel panel, boolean enabled) {
  2. JCheckBox checkBox = new JCheckBox();
  3. checkBox.setHorizontalAlignment(SwingConstants.CENTER);
  4. checkBox.setEnabled(enabled);
  5. panel.add(checkBox);
  6. return checkBox;
  7. }

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

  1. public BooleanEditor() {
  2. super(new JCheckBox());
  3. JCheckBox checkBox = (JCheckBox) getComponent();
  4. checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  5. }

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

  1. public BooleanEditor() {
  2. super(new JCheckBox());
  3. JCheckBox checkBox = (JCheckBox) getComponent();
  4. checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  5. }
  6. }

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

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

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

  1. public BooleanEditor() {
  2. super(new JCheckBox());
  3. JCheckBox checkBox = (JCheckBox) getComponent();
  4. checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  5. }

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

  1. public BooleanCellRenderer(TableCellRenderer delegate, JCheckBox checkBox, Predicate<?> predicate) {
  2. this.defaultDelegate = delegate;
  3. this.predicate = predicate;
  4. this.checkBox = checkBox;
  5. this.checkBox.setBorderPainted(true);
  6. this.checkBox.setHorizontalAlignment(JLabel.CENTER);
  7. }

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

  1. public SelectedCellEditor( JCheckBox selectValuesCheckBox, JCheckBox multipleChoiceCheckBox ) {
  2. this.selectValuesCheckBox = selectValuesCheckBox;
  3. this.multipleChoiceCheckBox = multipleChoiceCheckBox;
  4. radioBtn = new JRadioButton();
  5. checkbox = new JCheckBox();
  6. radioBtn.setHorizontalAlignment( JRadioButton.CENTER );
  7. checkbox.setHorizontalAlignment(JCheckBox.CENTER);
  8. radioBtn.addActionListener( (ActionListener)this );
  9. checkbox.addActionListener( (ActionListener)this );
  10. }

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

  1. public BooleanCellRenderer(TableCellRenderer delegate) {
  2. //super(new BorderLayout());
  3. this.checkBox = new JCheckBox();
  4. add(checkBox, BorderLayout.CENTER);
  5. checkBox.setHorizontalAlignment(JLabel.CENTER);
  6. checkBox.setBorderPainted(true);
  7. this.defaultDelegate = delegate;
  8. }

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

  1. /** Creates a new instance of BooleanTableCellRenderer */
  2. public BooleanTableCellRenderer() {
  3. super();
  4. super.setLayout(new BorderLayout(0, 0));
  5. checkBox = new JCheckBox();
  6. checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  7. checkBox.setOpaque(false);
  8. add(checkBox, BorderLayout.CENTER);
  9. }

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

  1. @Override
  2. public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  3. JComponent rendered = (JComponent) rendererDelegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
  4. if (rendered instanceof JCheckBox) {
  5. JCheckBox checkBox = (JCheckBox)rendered;
  6. checkBox.setHorizontalAlignment(JLabel.CENTER);
  7. checkBox.setVerticalTextPosition(JLabel.TOP);
  8. checkBox.setBorderPainted(true);
  9. checkBox.setIcon(icon);
  10. }
  11. return rendered;
  12. }

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

  1. private CheckBoxTableCellEditor() {
  2. super(new JCheckBox());
  3. ((JCheckBox)getEditorComponent()).setHorizontalAlignment(JLabel.CENTER);
  4. ((JCheckBox)getEditorComponent()).setBorderPainted(true);
  5. }

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

  1. private static void makeCellCheckBox(JCheckBox cb, Icon icon, Icon selIcon, String tooltip){
  2. cb.setHorizontalAlignment(JCheckBox.CENTER);
  3. if(icon != null){
  4. cb.setIcon(icon);
  5. }
  6. if(selIcon != null){
  7. cb.setSelectedIcon(selIcon);
  8. }
  9. cb.setOpaque(true);
  10. cb.setToolTipText(tooltip);
  11. }

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

  1. public BooleanCellRenderer(TableCellRenderer delegate, Icon icon) {
  2. //super(new BorderLayout());
  3. this.checkBox = new JCheckBox(icon);
  4. add(checkBox, BorderLayout.NORTH);
  5. checkBox.setHorizontalAlignment(JLabel.CENTER);
  6. checkBox.setVerticalTextPosition(JLabel.TOP);
  7. checkBox.setBorderPainted(true);
  8. this.defaultDelegate = delegate;
  9. }

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

  1. public BooleanEditor() {
  2. super(new SubstanceEditorCheckBox());
  3. JCheckBox checkBox = (JCheckBox) getComponent();
  4. checkBox.setOpaque(false);
  5. checkBox.setHorizontalAlignment(JCheckBox.CENTER);
  6. }
  7. }

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

  1. CheckBoxRenderer()
  2. {
  3. if (com.izforge.izpack.util.OsVersion.IS_UNIX && !com.izforge.izpack.util.OsVersion.IS_OSX)
  4. {
  5. checkbox.setIcon(new LFIndependentIcon());
  6. checkbox.setDisabledIcon(new LFIndependentIcon());
  7. checkbox.setSelectedIcon(new LFIndependentIcon());
  8. checkbox.setDisabledSelectedIcon(new LFIndependentIcon());
  9. }
  10. checkbox.setHorizontalAlignment(CENTER);
  11. }

相关文章

JCheckBox类方法