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

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

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

JButton.setFocusPainted介绍

暂无

代码示例

代码示例来源:origin: skylot/jadx

public ProgressPanel(final MainWindow mainWindow, boolean showCancelButton) {
  progressLabel = new JLabel();
  progressBar = new JProgressBar(0, 100);
  progressBar.setIndeterminate(true);
  progressBar.setStringPainted(false);
  progressLabel.setLabelFor(progressBar);
  setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
  setVisible(false);
  add(progressLabel);
  add(progressBar);
  if (showCancelButton) {
    JButton cancelButton = new JButton(ICON_CANCEL);
    cancelButton.setPreferredSize(new Dimension(ICON_CANCEL.getIconWidth(), ICON_CANCEL.getIconHeight()));
    cancelButton.setToolTipText("Cancel background jobs");
    cancelButton.setBorderPainted(false);
    cancelButton.setFocusPainted(false);
    cancelButton.setContentAreaFilled(false);
    cancelButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        mainWindow.cancelBackgroundJobs();
      }
    });
    add(cancelButton);
  }
}

代码示例来源:origin: redwarp/9-Patch-Resizer

inputPanel.setLayout(new BorderLayout(0, 0));
this.xhdpiButton.setBorderPainted(false);
this.xhdpiButton.setFocusPainted(false);
this.xhdpiButton.setVerticalTextPosition(SwingConstants.BOTTOM);
this.xhdpiButton.setHorizontalTextPosition(SwingConstants.CENTER);

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

public TablesButtonColumn(JTable table, Action action, int column) {
  super();
  this.table = table;
  this.action = action;
  renderButton = new JButton();
  editButton = new JButton();
  editButton.setFocusPainted(false);
  editButton.addActionListener(this);
  setGUISize();
  TableColumnModel columnModel = table.getColumnModel();
  columnModel.getColumn(column).setCellRenderer(this);
  columnModel.getColumn(column).setCellEditor(this);
  table.addMouseListener(this);
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

bReload.setSelectedIcon(bReload.getIcon());
bReload.setToolTipText(NbBundle.getMessage(HtmlBrowser.class, "CTL_Reload")); //NOI18N
bReload.setFocusPainted(false);
bStop.setSelectedIcon(bStop.getIcon());
bStop.setToolTipText(NbBundle.getMessage(HtmlBrowser.class, "CTL_Stop")); //NOI18N
bStop.setFocusPainted(false);

代码示例来源:origin: locationtech/jts

public static JButton createButton(ImageIcon icon, String tip, ActionListener action ) {
 JButton btn = new JButton();
 btn.setToolTipText(tip);
 btn.setIcon(icon);
 btn.setMargin(new Insets(0, 0, 0, 0));
 if (action != null) btn.addActionListener(action);
 btn.setFocusable(false);
 btn.setFocusPainted(false);
 return btn;
}

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

for (int ii = 0; ii < 20; ii++) {
  JButton jb1 = new JButton(new ImageIcon(img));
  JPanel panel = new JPanel(new BorderLayout());
  jb1.setMargin(new Insets(0, 0, 0, 0));
  jb1.setContentAreaFilled(false);
  jb1.setFocusPainted(false);
  jb1.setBorder(new EmptyBorder(0, 0, 0, 0));

  panel.add(jb1);
  add(panel);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

/**
 * Returns a <code>JButton</code> appropriate for placement on the
 * TitlePane.
 */
private JButton createTitleButton()
{
  JButton button = new JButton();
  button.setFocusPainted(false);
  button.setFocusable(false);
  button.setOpaque(false);
  return button;
}

代码示例来源:origin: com.cedarsoft.commons/swing-presenter

@Override
@NotNull
protected JButton createPresentation() {
 JButton button = new JButton();
 button.setBorder( BorderFactory.createEmptyBorder() );
 button.setContentAreaFilled( false );
 button.setFocusPainted( false );
 button.setMargin( new Insets( 0, 0, 0, 0 ) );
 button.setBorderPainted( false );
 return button;
}

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

protected void createResetButton() {
  $objectMap.put("resetButton", resetButton = new JButton());
  
  resetButton.setName("resetButton");
  resetButton.setFocusable(false);
  resetButton.setFocusPainted(false);
  resetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__resetButton"));
}

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

protected void createResetButton() {
  $objectMap.put("resetButton", resetButton = new JButton());
  
  resetButton.setName("resetButton");
  resetButton.setFocusable(false);
  resetButton.setFocusPainted(false);
  resetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__resetButton"));
}

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

protected void createResetButton() {
  $objectMap.put("resetButton", resetButton = new JButton());
  
  resetButton.setName("resetButton");
  resetButton.setFocusable(false);
  resetButton.setFocusPainted(false);
  resetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__resetButton"));
}

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

protected void createResetButton() {
  $objectMap.put("resetButton", resetButton = new JButton());
  
  resetButton.setName("resetButton");
  resetButton.setFocusPainted(false);
  resetButton.setFocusable(false);
  resetButton.setToolTipText(t("fileeditor.action.reset.tip"));
  resetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__resetButton"));
}

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

protected void createDownSize() {
  $objectMap.put("downSize", downSize = new JButton());
  
  downSize.setName("downSize");
  downSize.setFocusPainted(false);
  downSize.setFocusable(false);
  downSize.setToolTipText(t("fontsize.action.down.tip"));
  downSize.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__downSize"));
}

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

protected void createDownSize() {
  $objectMap.put("downSize", downSize = new JButton());
  
  downSize.setName("downSize");
  downSize.setFocusPainted(false);
  downSize.setFocusable(false);
  downSize.setToolTipText(t("fontsize.action.down.tip"));
  downSize.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__downSize"));
}

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

protected void createUpSize() {
  $objectMap.put("upSize", upSize = new JButton());
  
  upSize.setName("upSize");
  upSize.setFocusPainted(false);
  upSize.setFocusable(false);
  upSize.setToolTipText(t("fontsize.action.up.tip"));
  upSize.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__upSize"));
}

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

/**
 * Sets the decoration properties required to give the specified button a 'rollover' look and feel.
 *
 * @param button the button to 'rollover-enable'
 */
public static void setButtonDecoration(JButton button) {
  // Set button decorations and rollover behavior
  button.setRolloverEnabled(true);
  button.setFocusPainted(false);
  button.setBorderPainted(false);
}

代码示例来源:origin: org.trypticon.hex/hex-viewer

private void setCommonButtonProperties(JButton button) {
  button.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
  button.setBorderPainted(false);
  button.setOpaque(false);
  button.setContentAreaFilled(false);
  button.setFocusPainted(false);
  button.setOpaque(false);
}

代码示例来源:origin: com.github.arnabk/pgslookandfeel

protected JButton createArrowButton() {
  JButton button = new PgsComboBoxButtonUI(
      comboBox, new PgsComboBoxIcon(),
      comboBox.isEditable(),
      currentValuePane, listBox);
  button.setMargin(new Insets(1, 1, 1, 1));
  button.setFocusPainted(comboBox.isEditable());
  return button;
}

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

protected void create$JButton13() {
  $objectMap.put("$JButton13", $JButton13 = new JButton());
  
  $JButton13.setName("$JButton13");
  if ($JButton13.getFont() != null) {
    $JButton13.setFont($JButton13.getFont().deriveFont((float) 14));
  }
  $JButton13.setFocusable(false);
  $JButton13.setFocusPainted(false);
  $JButton13.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__$JButton13"));
  $JButton13.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__$JButton13"));
  $JButton13.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__$JButton13"));
}

代码示例来源:origin: org.biojava.thirdparty/forester

void addJButton( final JButton jb, final JPanel p ) {
  jb.setFocusPainted( false );
  jb.setFont( ControlPanel.jcb_font );
  if ( !_configuration.isUseNativeUI() ) {
    jb.setBorder( BorderFactory.createLineBorder( getConfiguration().getGuiButtonBorderColor() ) );
    jb.setBackground( getConfiguration().getGuiButtonBackgroundColor() );
    jb.setForeground( getConfiguration().getGuiButtonTextColor() );
  }
  p.add( jb );
  jb.addActionListener( this );
}

相关文章

JButton类方法