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

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

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

JButton.setRequestFocusEnabled介绍

暂无

代码示例

代码示例来源:origin: protegeproject/protege

  1. public void addAction(Action action) {
  2. JButton button = toolBar.add(action);
  3. button.setRequestFocusEnabled(false);
  4. }

代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application

  1. public void addAction(Action action) {
  2. JButton button = toolBar.add(action);
  3. button.setRequestFocusEnabled(false);
  4. }

代码示例来源:origin: org.protege/protege-editor-core-application

  1. public void addAction(Action action) {
  2. JButton button = toolBar.add(action);
  3. button.setRequestFocusEnabled(false);
  4. }

代码示例来源:origin: org.activecomponents.jadex/jadex-commons-gui

  1. /**
  2. * Create a tool bar, given a list of actions.
  3. * @param name The name of the toolbar.
  4. * @param actions The actions (null is mapped to separator).
  5. * @return A tool bar containing the actions.
  6. */
  7. public static JToolBar createToolBar(String name, Action[] actions)
  8. {
  9. // Create toolbar.
  10. JToolBar toolbar = new JToolBar(name);
  11. toolbar.addSeparator();
  12. for(int i=0; i<actions.length; i++)
  13. {
  14. if(actions[i]==null)
  15. {
  16. toolbar.addSeparator();
  17. }
  18. else
  19. {
  20. JButton button = new JButton(actions[i]);
  21. button.setToolTipText((String)actions[i].getValue(Action.NAME));
  22. button.setText("");
  23. button.setActionCommand((String)actions[i].getValue(Action.NAME));
  24. button.setRequestFocusEnabled(false);
  25. button.setMargin(new Insets(1, 1, 1, 1));
  26. toolbar.add(button);
  27. }
  28. }
  29. return toolbar;
  30. }

代码示例来源:origin: syedlopez/proguard

  1. /**
  2. * Adds an image below the tab buttons, after all tabs have been added.
  3. * The image will only be as visible as permitted by the available space.
  4. *
  5. * @param image the image.
  6. * @return the component containing the image.
  7. */
  8. public Component addImage(final Image image)
  9. {
  10. GridBagConstraints imageConstraints = new GridBagConstraints();
  11. imageConstraints.gridx = 0;
  12. imageConstraints.weighty = 1.0;
  13. imageConstraints.fill = GridBagConstraints.BOTH;
  14. imageConstraints.anchor = GridBagConstraints.SOUTHWEST;
  15. JButton component = new JButton(new ImageIcon(image));
  16. component.setFocusPainted(false);
  17. component.setFocusable(false);
  18. component.setRequestFocusEnabled(false);
  19. component.setRolloverEnabled(false);
  20. component.setMargin(new Insets(0, 0, 0, 0));
  21. component.setHorizontalAlignment(JButton.LEFT);
  22. component.setVerticalAlignment(JButton.BOTTOM);
  23. component.setPreferredSize(new Dimension(0, 0));
  24. add(component, imageConstraints);
  25. return component;
  26. }

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

  1. @SuppressWarnings({"MethodMayBeStatic"})
  2. protected JButton createOneTouchButton(int dir) {
  3. JButton b = NapkinUtil.createArrowButton(dir, ARROW_SIZE);
  4. b.setFocusable(false);
  5. b.setMinimumSize(new Dimension(SIZE, SIZE));
  6. b.setCursor(DEFAULT_CURSOR);
  7. b.setFocusPainted(false);
  8. b.setBorderPainted(false);
  9. b.setRequestFocusEnabled(false);
  10. return b;
  11. }

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

  1. Title(String _title)
  2. {
  3. JLabel t=new JLabel(_title);
  4. t.setFont(BuLib.deriveFont("InternalFrameTitlePane",Font.PLAIN,-2));
  5. t.setForeground(Color.white);
  6. t.setBorder(new EmptyBorder(1,2,0,2));
  7. JButton b=new JButton("-");
  8. b.setFont(BuLib.deriveFont("InternalFrameTitlePane",Font.BOLD,-2));
  9. b.setBorder(new EmptyBorder(0,2,0,2));
  10. b.setRequestFocusEnabled(false);
  11. b.setActionCommand("LINIFY");
  12. // b.addActionListener(BuPopupWindow.this);
  13. this.setBackground(this.getBackground().darker());
  14. this.setOpaque(true);
  15. this.setLayout(new BuBorderLayout());
  16. this.add(t,BuBorderLayout.CENTER);
  17. this.add(b,BuBorderLayout.EAST);
  18. }
  19. }

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

  1. closeBox.setRequestFocusEnabled(false);
  2. closeBox.setToolTipText(jEdit.getProperty("view.docking.close-tooltip"));
  3. if(OperatingSystem.isMacOSLF())
  4. menuBtn.setRequestFocusEnabled(false);
  5. menuBtn.setToolTipText(jEdit.getProperty("view.docking.menu-tooltip"));
  6. if(OperatingSystem.isMacOSLF())

代码示例来源:origin: net.sf.squirrel-sql.plugins/refactoring

  1. pane.add(columnTF, getFieldConstraints(c));
  2. super.executeButton.setRequestFocusEnabled(true);

代码示例来源:origin: net.sf.squirrel-sql.plugins/refactoring

  1. cascadeCB.setPreferredSize(mediumField);
  2. pane.add(cascadeCB, getFieldConstraints(c));
  3. super.executeButton.setRequestFocusEnabled(true);

代码示例来源:origin: net.sf.squirrel-sql.plugins/refactoring

  1. super.executeButton.setRequestFocusEnabled(true);

代码示例来源:origin: net.sf.squirrel-sql.plugins/refactoring

  1. _cascadeCB.setPreferredSize(mediumField);
  2. pane.add(_cascadeCB, getFieldConstraints(c));
  3. super.executeButton.setRequestFocusEnabled(true);

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

  1. panel.setSize(this.getSize());
  2. b1 = new JButton("Start");// The JButton name.
  3. b1.setRequestFocusEnabled(false);
  4. b1.addFocusListener(this);
  5. b1.setLocation(10, 12);
  6. b2.setRequestFocusEnabled(false);
  7. b2.addFocusListener(this);
  8. b2.setLocation(70, 12);

代码示例来源:origin: Revivius/nb-darcula

  1. b.setFocusPainted(false);
  2. b.setBorderPainted(false);
  3. b.setRequestFocusEnabled(false);
  4. return b;

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

  1. b[i].setRequestFocusEnabled(false);
  2. b[i].setMargin(BuInsets.INSETS1111);
  3. scp_.add(b[i]);

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

  1. /**
  2. * This public method is implementation specific and should be private. Do
  3. * not call or override.
  4. */
  5. public void configureArrowButton()
  6. {
  7. if (arrowButton != null)
  8. {
  9. arrowButton.setEnabled(comboBox.isEnabled());
  10. arrowButton.setRequestFocusEnabled(false);
  11. arrowButton.addMouseListener(popup.getMouseListener());
  12. arrowButton.addMouseMotionListener(popup.getMouseMotionListener());
  13. arrowButton.resetKeyboardActions();
  14. }
  15. }

代码示例来源:origin: Revivius/nb-darcula

  1. b.setFocusPainted(false);
  2. b.setBorderPainted(false);
  3. b.setRequestFocusEnabled(false);
  4. return b;

代码示例来源:origin: com.jidesoft/jide-oss

  1. b.setFocusPainted(false);
  2. b.setBorderPainted(false);
  3. b.setRequestFocusEnabled(false);
  4. return b;

代码示例来源:origin: lbalazscs/Pixelitor

  1. private void initDropDownButton() {
  2. dropDownButton = new JButton(downIconEnabled);
  3. dropDownButton.setDisabledIcon(downIconDisabled);
  4. dropDownButton.putClientProperty("JComponent.sizeVariant", "mini");
  5. dropDownButton.setRequestFocusEnabled(false);
  6. dropDownButton.setInheritsPopupMenu(true);
  7. dropDownButton.setBorderPainted(false);
  8. dropDownButton.setFocusPainted(false);
  9. dropDownButton.addMouseListener(new MouseAdapter() {
  10. @Override
  11. public void mousePressed(MouseEvent e) {
  12. dropDown();
  13. }
  14. @Override
  15. public void mouseEntered(MouseEvent e) {
  16. dropDownButton.setBorderPainted(true);
  17. }
  18. @Override
  19. public void mouseExited(MouseEvent e) {
  20. dropDownButton.setBorderPainted(false);
  21. }
  22. });
  23. dropDownButton.setIconTextGap(0);
  24. dropDownButton.setBorder(null);
  25. dropDownButton.setMargin(new Insets(0, 0, 0, 0));
  26. setDropDownButtonSize();
  27. }

代码示例来源:origin: org.java.net.substance/substance

  1. oneTouchButton.setFocusPainted(false);
  2. oneTouchButton.setBorderPainted(false);
  3. oneTouchButton.setRequestFocusEnabled(false);

相关文章

JButton类方法