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

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

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

JButton.setFocusable介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

protected void initializeLoggingToolbar() {
  toolBar.setMargin(new Insets(5, 0, 5, 0));
  toolBar.setFloatable(false);
  toolBar.add(copyButton);
  copyButton.setFocusable(false);
  copyButton.setEnabled(false);
  copyButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      StringBuilder sb = new StringBuilder();
      List<StateVariableValue> messages = getSelectedValue();
      for (StateVariableValue message : messages) {
        sb.append(message.toString()).append("\n");
      }
      Application.copyToClipboard(sb.toString());
    }
  });
  toolBar.setFloatable(false);
  toolBar.add(copyButton);
  toolBar.add(Box.createHorizontalGlue());
}

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

button.setUI(new BasicButtonUI());
button.setContentAreaFilled(false);
button.setFocusable(false);
button.setBorder(null);
button.setBorderPainted(false);

代码示例来源:origin: 4thline/cling

protected void initializeToolBar(LogController.Expiration expiration) {
  configureButton.setFocusable(false);
  configureButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
  clearButton.setFocusable(false);
  clearButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
  copyButton.setFocusable(false);
  copyButton.setEnabled(false);
  copyButton.addActionListener(new ActionListener() {
  expandButton.setFocusable(false);
  expandButton.setEnabled(false);
  expandButton.addActionListener(new ActionListener() {
  pauseButton.setFocusable(false);
  pauseButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {

代码示例来源:origin: 4thline/cling

public URIPanel() {
  super();
  setBorder(BorderFactory.createTitledBorder("Current URI"));
  setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
  add(uriTextField);
  setButton.setFocusable(false);
  add(setButton);
}

代码示例来源:origin: 4thline/cling

useButton.setFocusable(false);
toolbar.add(useButton);
monitorButton.setFocusable(false);
toolbar.add(monitorButton);
invokeButton.setFocusable(false);
toolbar.add(invokeButton);
queryButton.setFocusable(false);
toolbar.add(queryButton);
copyButton.setFocusable(false);
toolbar.add(copyButton);
closeButton.setFocusable(false);
toolbar.add(closeButton);

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

button.setIcon(new ImageIcon(scaledImage));
button.putClientProperty(SubstanceSynapse.FLAT_LOOK, Boolean.TRUE);
button.setFocusable(false);
button.addActionListener(e ->

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

north.add(zoomMore);
north.add(zoomLess);
copy.setFocusable(false);
copy.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent ae) {
next.setFocusable(false);
next.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent ae) {
previous.setFocusable(false);
previous.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent ae) {
zoomMore.setFocusable(false);
zoomMore.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent ae) {
zoomLess.setFocusable(false);
zoomLess.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent ae) {

代码示例来源:origin: 4thline/cling

statusIconButton.setFocusable(false);

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

colorPickerBtn.setFocusable(false);
colorPickerBtn.setBackground(existingColor);
colorPickerBtn.addMouseListener(new MouseAdapter()

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

BufferedImage startButton = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup.png"));
BufferedImage startButtonHover = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_hover.png"));
BufferedImage startButtonActive = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_active.png"));

JButton startBackupButton = new JButton(new ImageIcon(startButton));
startBackupButton.setRolloverIcon(new ImageIcon(startButtonHover));
startBackupButton.setPressedIcon(new ImageIcon(startButtonActive));
startBackupButton.setBorder(BorderFactory.createEmptyBorder());
startBackupButton.setContentAreaFilled(false);
startBackupButton.setFocusable(false);

代码示例来源:origin: 4thline/cling

copyURIButton.setFocusable(false);
copyURIButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
copyProtocolInfoButton.setFocusable(false);
copyProtocolInfoButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {

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

btnConnect.setFocusable(false);
btnConnect.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnSendMessage.setFocusable(false);
btnSendMessage.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnSendMessage.setText("Send Message");

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

btnPreferences.setText("Preferences");
btnPreferences.setToolTipText("By changing the settings in the preferences window you can adjust the look and behaviour of xmage.");
btnPreferences.setFocusable(false);
btnPreferences.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
btnPreferences.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnConnect.setFocusable(false);
btnConnect.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
btnConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnDeckEditor.setText("Deck Editor");
btnDeckEditor.setToolTipText("Start the deck editor to create or modify decks.");
btnDeckEditor.setFocusable(false);
btnDeckEditor.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
btnDeckEditor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnCollectionViewer.setText("Viewer");
btnCollectionViewer.setToolTipText("Card viewer to show the cards of sets. ");
btnCollectionViewer.setFocusable(false);
btnCollectionViewer.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
btnCollectionViewer.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnSendFeedback.setText("Feedback");
btnSendFeedback.setToolTipText("Send some feedback to the developers.");
btnSendFeedback.setFocusable(false);
btnSendFeedback.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
btnSendFeedback.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnSymbols.setText("Symbols");

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

/**
 * Creates a small 'close' JButton with close icon, rollover icon and pressed icon according to Look and Feel
 *
 * @return JButton with close icons.
 */
public static JButton createCloseButton() {
  JButton closeButton = new JButton();
  int size = 16;
  closeButton.setPreferredSize(new Dimension(size, size));
  closeButton.setContentAreaFilled(false);
  closeButton.setFocusable(false);
  closeButton.setBorder(BorderFactory.createEmptyBorder());
  closeButton.setBorderPainted(false);
  closeButton.setRolloverEnabled(true);
  closeButton.setIcon(ImageUtilities.image2Icon(getCloseTabImage()));
  closeButton.setRolloverIcon(ImageUtilities.image2Icon(getCloseTabRolloverImage()));
  closeButton.setPressedIcon(ImageUtilities.image2Icon(getCloseTabPressedImage()));
  return closeButton;
}

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

/**
 * Creates a big 'close' JButton with close icon, rollover icon and pressed icon according to Look and Feel
 *
 * @return JButton with close icons.
 */
public static JButton createBigCloseButton() {
  JButton closeButton = new JButton();
  int size = 19;
  closeButton.setPreferredSize(new Dimension(size, size));
  closeButton.setContentAreaFilled(false);
  closeButton.setFocusable(false);
  closeButton.setBorder(BorderFactory.createEmptyBorder());
  closeButton.setBorderPainted(false);
  closeButton.setRolloverEnabled(true);
  closeButton.setIcon(ImageUtilities.image2Icon(getBigCloseTabImage()));
  closeButton.setRolloverIcon(ImageUtilities.image2Icon(getBigCloseTabRolloverImage()));
  closeButton.setPressedIcon(ImageUtilities.image2Icon(getBigCloseTabPressedImage()));
  return closeButton;
}

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

public void init(UUID gameId, UUID playerId, BigCard bigCard, int priorityTime) {
  this.gameId = gameId;
  this.playerId = playerId;
  this.bigCard = bigCard;
  cheat.setVisible(SessionHandler.isTestMode());
  cheat.setFocusable(false);
  flagName = null;
  if (priorityTime > 0) {
    long delay = 1000L;
    timer = new PriorityTimer(priorityTime, delay, () -> {
      // do nothing
    });
    final PriorityTimer pt = timer;
    timer.setTaskOnTick(() -> {
      int priorityTimeValue = pt.getCount();
      String text = getPriorityTimeLeftString(priorityTimeValue);
      PlayerPanelExt.this.avatar.setTopText(text);
      PlayerPanelExt.this.timerLabel.setText(text);
      PlayerPanelExt.this.avatar.repaint();
    });
    timer.init(gameId);
  }
}

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

btnConcede.setIcon(new ImageIcon(ImageManagerImpl.instance.getConcedeButtonImage()));
btnConcede.setToolTipText("Concede the current game.");
btnConcede.setFocusable(false);
btnConcede.addMouseListener(new MouseAdapter() {
  @Override
btnSwitchHands.setBorder(new EmptyBorder(0, 0, 0, 0));
btnSwitchHands.setIcon(new ImageIcon(ImageManagerImpl.instance.getSwitchHandsButtonImage()));
btnSwitchHands.setFocusable(false);
btnSwitchHands.setToolTipText("Switch between your hand cards and hand cards of controlled players.");
btnSwitchHands.addMouseListener(new MouseAdapter() {
btnStopWatching.setBorder(new EmptyBorder(0, 0, 0, 0));
btnStopWatching.setIcon(new ImageIcon(ImageManagerImpl.instance.getStopWatchButtonImage()));
btnStopWatching.setFocusable(false);
btnStopWatching.setToolTipText("Stop watching this game.");
btnStopWatching.addMouseListener(new MouseAdapter() {

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

btnExpansionSearch.setToolTipText("Fast search set or expansion");
btnExpansionSearch.setAlignmentX(1.0F);
btnExpansionSearch.setFocusable(false);
btnExpansionSearch.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnExpansionSearch.setPreferredSize(new java.awt.Dimension(23, 23));
btnBooster.setFocusable(false);
btnBooster.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnBooster.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnClear.setFocusable(false);
btnClear.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnClear.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

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

btnQuickStart.setFocusable(false);
btnQuickStart.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnQuickStart.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

代码示例来源: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;
}

相关文章

JButton类方法