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

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

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

JButton.addMouseMotionListener介绍

暂无

代码示例

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

public class ResizablePanel extends JPanel {

 public ResizablePanel(JComponent body) {

  setLayout(new BorderLayout());
  JButton resize = new JButton();
  resize.setPreferredSize(new Dimension(Integer.MAX_VALUE, 4));
  resize.addMouseMotionListener(new MouseAdapter() {
    public void mouseDragged(MouseEvent e) {
      Dimension preferredSize = ResizablePanel.this.getPreferredSize();
      ResizablePanel.this.setPreferredSize(new Dimension(preferredSize.width, preferredSize.height-e.getY()));
      ResizablePanel.this.revalidate();
    }
  });             
  add(resize, BorderLayout.PAGE_START);
  add(body, BorderLayout.CENTER);
 }
}

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

protected JButton createButton(Action action) {
  if (actions == null) {
    throw new IllegalArgumentException("actions==null");
  }
  if (actions2buttonMap.containsKey(action)) {
    return actions2buttonMap.get(action);
  }
  JButton button = null;
  button = new JButton();
  button.setAction(action);
  button.setOpaque(false);
  button.setBorderPainted(false);
  javax.swing.Icon ico = (javax.swing.Icon) action.getValue(Action.SMALL_ICON);
  if (ico != null) {
    int prefAddX = 2;
    int prefAddY = 2;
    Dimension closeButtonPrefSize = new Dimension(
        ico.getIconWidth() + prefAddX,
        ico.getIconHeight() + prefAddY);
    button.setPreferredSize(closeButtonPrefSize);
  }
  button.addMouseListener(closeButtonML);
  button.addMouseMotionListener(closeButtonML);
  actions2buttonMap.put(action, button);
  button2actionMap.put(button, action);
  return button;
}

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

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

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

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

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

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

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

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

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

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

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

/**
 * This public method is implementation specific and should be private. Do
 * not call or override.
 */
public void configureArrowButton()
{
  if (arrowButton != null)
  {
    arrowButton.setEnabled(comboBox.isEnabled());
    arrowButton.setRequestFocusEnabled(false);
    arrowButton.addMouseListener(popup.getMouseListener());
    arrowButton.addMouseMotionListener(popup.getMouseMotionListener());
    arrowButton.resetKeyboardActions();
  }
}

代码示例来源:origin: com.github.lgooddatepicker/LGoodDatePicker

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

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

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

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

popupButton.addMouseMotionListener(mouseMotionListener);

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

popupButton.addMouseMotionListener(mouseMotionListener);

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

popupButton.addMouseMotionListener(mouseMotionListener);

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

popupButton.addMouseMotionListener(mouseMotionListener);

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

popupButton.addMouseMotionListener(mouseMotionListener);

相关文章

JButton类方法