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

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

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

JButton.setFocusable介绍

暂无

代码示例

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

  1. protected void initializeLoggingToolbar() {
  2. toolBar.setMargin(new Insets(5, 0, 5, 0));
  3. toolBar.setFloatable(false);
  4. toolBar.add(copyButton);
  5. copyButton.setFocusable(false);
  6. copyButton.setEnabled(false);
  7. copyButton.addActionListener(new ActionListener() {
  8. public void actionPerformed(ActionEvent e) {
  9. StringBuilder sb = new StringBuilder();
  10. List<StateVariableValue> messages = getSelectedValue();
  11. for (StateVariableValue message : messages) {
  12. sb.append(message.toString()).append("\n");
  13. }
  14. Application.copyToClipboard(sb.toString());
  15. }
  16. });
  17. toolBar.setFloatable(false);
  18. toolBar.add(copyButton);
  19. toolBar.add(Box.createHorizontalGlue());
  20. }

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

  1. button.setUI(new BasicButtonUI());
  2. button.setContentAreaFilled(false);
  3. button.setFocusable(false);
  4. button.setBorder(null);
  5. button.setBorderPainted(false);

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

  1. protected void initializeToolBar(LogController.Expiration expiration) {
  2. configureButton.setFocusable(false);
  3. configureButton.addActionListener(new ActionListener() {
  4. public void actionPerformed(ActionEvent e) {
  5. clearButton.setFocusable(false);
  6. clearButton.addActionListener(new ActionListener() {
  7. public void actionPerformed(ActionEvent e) {
  8. copyButton.setFocusable(false);
  9. copyButton.setEnabled(false);
  10. copyButton.addActionListener(new ActionListener() {
  11. expandButton.setFocusable(false);
  12. expandButton.setEnabled(false);
  13. expandButton.addActionListener(new ActionListener() {
  14. pauseButton.setFocusable(false);
  15. pauseButton.addActionListener(new ActionListener() {
  16. public void actionPerformed(ActionEvent e) {

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

  1. public URIPanel() {
  2. super();
  3. setBorder(BorderFactory.createTitledBorder("Current URI"));
  4. setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
  5. add(uriTextField);
  6. setButton.setFocusable(false);
  7. add(setButton);
  8. }

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

  1. useButton.setFocusable(false);
  2. toolbar.add(useButton);
  3. monitorButton.setFocusable(false);
  4. toolbar.add(monitorButton);
  5. invokeButton.setFocusable(false);
  6. toolbar.add(invokeButton);
  7. queryButton.setFocusable(false);
  8. toolbar.add(queryButton);
  9. copyButton.setFocusable(false);
  10. toolbar.add(copyButton);
  11. closeButton.setFocusable(false);
  12. toolbar.add(closeButton);

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

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

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

  1. north.add(zoomMore);
  2. north.add(zoomLess);
  3. copy.setFocusable(false);
  4. copy.addActionListener(new ActionListener() {
  5. public void actionPerformed(ActionEvent ae) {
  6. next.setFocusable(false);
  7. next.addActionListener(new ActionListener() {
  8. public void actionPerformed(ActionEvent ae) {
  9. previous.setFocusable(false);
  10. previous.addActionListener(new ActionListener() {
  11. public void actionPerformed(ActionEvent ae) {
  12. zoomMore.setFocusable(false);
  13. zoomMore.addActionListener(new ActionListener() {
  14. public void actionPerformed(ActionEvent ae) {
  15. zoomLess.setFocusable(false);
  16. zoomLess.addActionListener(new ActionListener() {
  17. public void actionPerformed(ActionEvent ae) {

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

  1. statusIconButton.setFocusable(false);

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

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

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

  1. BufferedImage startButton = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup.png"));
  2. BufferedImage startButtonHover = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_hover.png"));
  3. BufferedImage startButtonActive = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_active.png"));
  4. JButton startBackupButton = new JButton(new ImageIcon(startButton));
  5. startBackupButton.setRolloverIcon(new ImageIcon(startButtonHover));
  6. startBackupButton.setPressedIcon(new ImageIcon(startButtonActive));
  7. startBackupButton.setBorder(BorderFactory.createEmptyBorder());
  8. startBackupButton.setContentAreaFilled(false);
  9. startBackupButton.setFocusable(false);

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

  1. copyURIButton.setFocusable(false);
  2. copyURIButton.addActionListener(new ActionListener() {
  3. public void actionPerformed(ActionEvent e) {
  4. copyProtocolInfoButton.setFocusable(false);
  5. copyProtocolInfoButton.addActionListener(new ActionListener() {
  6. public void actionPerformed(ActionEvent e) {

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

  1. btnConnect.setFocusable(false);
  2. btnConnect.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  3. btnConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  4. btnSendMessage.setFocusable(false);
  5. btnSendMessage.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  6. btnSendMessage.setText("Send Message");

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

  1. btnPreferences.setText("Preferences");
  2. btnPreferences.setToolTipText("By changing the settings in the preferences window you can adjust the look and behaviour of xmage.");
  3. btnPreferences.setFocusable(false);
  4. btnPreferences.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
  5. btnPreferences.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  6. btnConnect.setFocusable(false);
  7. btnConnect.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
  8. btnConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  9. btnDeckEditor.setText("Deck Editor");
  10. btnDeckEditor.setToolTipText("Start the deck editor to create or modify decks.");
  11. btnDeckEditor.setFocusable(false);
  12. btnDeckEditor.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
  13. btnDeckEditor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  14. btnCollectionViewer.setText("Viewer");
  15. btnCollectionViewer.setToolTipText("Card viewer to show the cards of sets. ");
  16. btnCollectionViewer.setFocusable(false);
  17. btnCollectionViewer.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
  18. btnCollectionViewer.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  19. btnSendFeedback.setText("Feedback");
  20. btnSendFeedback.setToolTipText("Send some feedback to the developers.");
  21. btnSendFeedback.setFocusable(false);
  22. btnSendFeedback.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
  23. btnSendFeedback.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  24. btnSymbols.setText("Symbols");

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

  1. /**
  2. * Creates a small 'close' JButton with close icon, rollover icon and pressed icon according to Look and Feel
  3. *
  4. * @return JButton with close icons.
  5. */
  6. public static JButton createCloseButton() {
  7. JButton closeButton = new JButton();
  8. int size = 16;
  9. closeButton.setPreferredSize(new Dimension(size, size));
  10. closeButton.setContentAreaFilled(false);
  11. closeButton.setFocusable(false);
  12. closeButton.setBorder(BorderFactory.createEmptyBorder());
  13. closeButton.setBorderPainted(false);
  14. closeButton.setRolloverEnabled(true);
  15. closeButton.setIcon(ImageUtilities.image2Icon(getCloseTabImage()));
  16. closeButton.setRolloverIcon(ImageUtilities.image2Icon(getCloseTabRolloverImage()));
  17. closeButton.setPressedIcon(ImageUtilities.image2Icon(getCloseTabPressedImage()));
  18. return closeButton;
  19. }

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

  1. /**
  2. * Creates a big 'close' JButton with close icon, rollover icon and pressed icon according to Look and Feel
  3. *
  4. * @return JButton with close icons.
  5. */
  6. public static JButton createBigCloseButton() {
  7. JButton closeButton = new JButton();
  8. int size = 19;
  9. closeButton.setPreferredSize(new Dimension(size, size));
  10. closeButton.setContentAreaFilled(false);
  11. closeButton.setFocusable(false);
  12. closeButton.setBorder(BorderFactory.createEmptyBorder());
  13. closeButton.setBorderPainted(false);
  14. closeButton.setRolloverEnabled(true);
  15. closeButton.setIcon(ImageUtilities.image2Icon(getBigCloseTabImage()));
  16. closeButton.setRolloverIcon(ImageUtilities.image2Icon(getBigCloseTabRolloverImage()));
  17. closeButton.setPressedIcon(ImageUtilities.image2Icon(getBigCloseTabPressedImage()));
  18. return closeButton;
  19. }

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

  1. public void init(UUID gameId, UUID playerId, BigCard bigCard, int priorityTime) {
  2. this.gameId = gameId;
  3. this.playerId = playerId;
  4. this.bigCard = bigCard;
  5. cheat.setVisible(SessionHandler.isTestMode());
  6. cheat.setFocusable(false);
  7. flagName = null;
  8. if (priorityTime > 0) {
  9. long delay = 1000L;
  10. timer = new PriorityTimer(priorityTime, delay, () -> {
  11. // do nothing
  12. });
  13. final PriorityTimer pt = timer;
  14. timer.setTaskOnTick(() -> {
  15. int priorityTimeValue = pt.getCount();
  16. String text = getPriorityTimeLeftString(priorityTimeValue);
  17. PlayerPanelExt.this.avatar.setTopText(text);
  18. PlayerPanelExt.this.timerLabel.setText(text);
  19. PlayerPanelExt.this.avatar.repaint();
  20. });
  21. timer.init(gameId);
  22. }
  23. }

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

  1. btnConcede.setIcon(new ImageIcon(ImageManagerImpl.instance.getConcedeButtonImage()));
  2. btnConcede.setToolTipText("Concede the current game.");
  3. btnConcede.setFocusable(false);
  4. btnConcede.addMouseListener(new MouseAdapter() {
  5. @Override
  6. btnSwitchHands.setBorder(new EmptyBorder(0, 0, 0, 0));
  7. btnSwitchHands.setIcon(new ImageIcon(ImageManagerImpl.instance.getSwitchHandsButtonImage()));
  8. btnSwitchHands.setFocusable(false);
  9. btnSwitchHands.setToolTipText("Switch between your hand cards and hand cards of controlled players.");
  10. btnSwitchHands.addMouseListener(new MouseAdapter() {
  11. btnStopWatching.setBorder(new EmptyBorder(0, 0, 0, 0));
  12. btnStopWatching.setIcon(new ImageIcon(ImageManagerImpl.instance.getStopWatchButtonImage()));
  13. btnStopWatching.setFocusable(false);
  14. btnStopWatching.setToolTipText("Stop watching this game.");
  15. btnStopWatching.addMouseListener(new MouseAdapter() {

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

  1. btnExpansionSearch.setToolTipText("Fast search set or expansion");
  2. btnExpansionSearch.setAlignmentX(1.0F);
  3. btnExpansionSearch.setFocusable(false);
  4. btnExpansionSearch.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  5. btnExpansionSearch.setPreferredSize(new java.awt.Dimension(23, 23));
  6. btnBooster.setFocusable(false);
  7. btnBooster.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  8. btnBooster.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  9. btnClear.setFocusable(false);
  10. btnClear.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  11. btnClear.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

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

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

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

  1. public static JButton createButton(ImageIcon icon, String tip, ActionListener action ) {
  2. JButton btn = new JButton();
  3. btn.setToolTipText(tip);
  4. btn.setIcon(icon);
  5. btn.setMargin(new Insets(0, 0, 0, 0));
  6. if (action != null) btn.addActionListener(action);
  7. btn.setFocusable(false);
  8. btn.setFocusPainted(false);
  9. return btn;
  10. }

相关文章

JButton类方法