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

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

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

JButton.addMouseMotionListener介绍

暂无

代码示例

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

  1. public class ResizablePanel extends JPanel {
  2. public ResizablePanel(JComponent body) {
  3. setLayout(new BorderLayout());
  4. JButton resize = new JButton();
  5. resize.setPreferredSize(new Dimension(Integer.MAX_VALUE, 4));
  6. resize.addMouseMotionListener(new MouseAdapter() {
  7. public void mouseDragged(MouseEvent e) {
  8. Dimension preferredSize = ResizablePanel.this.getPreferredSize();
  9. ResizablePanel.this.setPreferredSize(new Dimension(preferredSize.width, preferredSize.height-e.getY()));
  10. ResizablePanel.this.revalidate();
  11. }
  12. });
  13. add(resize, BorderLayout.PAGE_START);
  14. add(body, BorderLayout.CENTER);
  15. }
  16. }

代码示例来源:origin: xyz.cofe/gui.swing

  1. protected JButton createButton(Action action) {
  2. if (actions == null) {
  3. throw new IllegalArgumentException("actions==null");
  4. }
  5. if (actions2buttonMap.containsKey(action)) {
  6. return actions2buttonMap.get(action);
  7. }
  8. JButton button = null;
  9. button = new JButton();
  10. button.setAction(action);
  11. button.setOpaque(false);
  12. button.setBorderPainted(false);
  13. javax.swing.Icon ico = (javax.swing.Icon) action.getValue(Action.SMALL_ICON);
  14. if (ico != null) {
  15. int prefAddX = 2;
  16. int prefAddY = 2;
  17. Dimension closeButtonPrefSize = new Dimension(
  18. ico.getIconWidth() + prefAddX,
  19. ico.getIconHeight() + prefAddY);
  20. button.setPreferredSize(closeButtonPrefSize);
  21. }
  22. button.addMouseListener(closeButtonML);
  23. button.addMouseMotionListener(closeButtonML);
  24. actions2buttonMap.put(action, button);
  25. button2actionMap.put(button, action);
  26. return button;
  27. }

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

  1. eyeDropper.addMouseMotionListener(mia);
  2. try {
  3. eyeDropper.setIcon(new ImageIcon(

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

  1. eyeDropper.addMouseMotionListener(mia);
  2. try {
  3. eyeDropper.setIcon(new ImageIcon(

代码示例来源:origin: org.swinglabs.swingx/swingx-all

  1. eyeDropper.addMouseMotionListener(mia);
  2. try {
  3. eyeDropper.setIcon(new ImageIcon(

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

  1. eyeDropper.addMouseMotionListener(mia);
  2. try {
  3. eyeDropper.setIcon(new ImageIcon(

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

  1. eyeDropper.addMouseMotionListener(mia);
  2. try {
  3. eyeDropper.setIcon(new ImageIcon(

代码示例来源: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: com.github.lgooddatepicker/LGoodDatePicker

  1. toggleTimeMenuButton.addMouseMotionListener(new MouseAdapter() {
  2. @Override
  3. public void mouseDragged(MouseEvent event) {

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

  1. theButton.addMouseMotionListener(mil);
  2. setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
  3. thePopupMenu = new JPopupMenu();

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

  1. popupButton.addMouseMotionListener(mouseMotionListener);

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

  1. popupButton.addMouseMotionListener(mouseMotionListener);

代码示例来源:origin: org.swinglabs.swingx/swingx-all

  1. popupButton.addMouseMotionListener(mouseMotionListener);

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

  1. popupButton.addMouseMotionListener(mouseMotionListener);

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

  1. popupButton.addMouseMotionListener(mouseMotionListener);

相关文章

JButton类方法