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

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

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

JButton.setCursor介绍

暂无

代码示例

代码示例来源:origin: leMaik/swing-material

@Override
public void setCursor(Cursor cursor) {
  super.setCursor(cursor);
  this.cursor = cursor;
}

代码示例来源:origin: Exslims/MercuryTrade

@Override
public void mouseExited(MouseEvent e) {
  button.setBorder(prevBorder);
  button.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: Exslims/MercuryTrade

@Override
  public void mouseExited(MouseEvent e) {
    button.setBorder(prevBorder);
    button.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  }
});

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public void setCursor(Cursor aCursor) {
  super.setCursor(aCursor);
}

代码示例来源:origin: net.imagej/imagej-ui-swing

/**
 * Add a link.
 * 
 * @param text
 *            the label of the link
 * @param action
 *            the action to perform when the link is clicked
 */
public void link(String text, ActionListener action) {
  final JButton button = new JButton(text);
  button.addActionListener(action);
  textPane.insertComponent(button);
  button.setCursor(handCursor);
}

代码示例来源:origin: Exslims/MercuryTrade

@Override
public void mouseEntered(MouseEvent e) {
  prevBorder = button.getBorder();
  button.setBorder(BorderFactory.createCompoundBorder(
      BorderFactory.createLineBorder(AppThemeColor.ADR_SELECTED_BORDER),
      BorderFactory.createEmptyBorder(3, 3, 3, 3)));
  button.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
    downloadsLabel.setText(NbBundle.getMessage(kenaiProjectTopComponent.class, "kenaiProjectTopComponent.downloadsLabel.text")); //NOI18N
    downloadsLabel.setIcon(null);
    downloadsLabel.setToolTipText(""); //NOI18N
    downloadsLabel.setCursor(Cursor.getDefaultCursor());
    downloadsLabel.removeActionListener(downloadsActionListener);
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
    wikiLabel.setText(NbBundle.getMessage(kenaiProjectTopComponent.class, "kenaiProjectTopComponent.wikiLabel.text")); //NOI18N
    wikiLabel.setIcon(null);
    wikiLabel.setToolTipText(""); //NOI18N
    wikiLabel.setCursor(Cursor.getDefaultCursor());
    wikiLabel.removeActionListener(wikiActionListener);
  }
});

代码示例来源:origin: leMaik/swing-material

@Override
public void setEnabled(boolean b) {
  super.setEnabled(b);
  elevation.setLevel(getElevation());
  super.setCursor(b ? cursor : Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: Exslims/MercuryTrade

@Override
public void mouseEntered(MouseEvent e) {
  this.prevBorder = button.getBorder();
  CompoundBorder compoundBorder = BorderFactory.createCompoundBorder(
      BorderFactory.createLineBorder(AppThemeColor.ADR_SELECTED_BORDER, 1),
      BorderFactory.createLineBorder(button.getBackground(), 3)
  );
  button.setBorder(compoundBorder);
  button.setCursor(new Cursor(Cursor.HAND_CURSOR));
}

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

private void styleDatePickerArrowButtons(JButton jButton) {
    jButton.setFont(new JButton("").getFont().deriveFont(Font.PLAIN, 24));
    jButton.setBackground(ColorConst.CONTENT_BACKGROUND);
    jButton.setForeground(ColorConst.SIDENAV_TITLE_FOREGROUND);
    jButton.setOpaque(false);
    jButton.setBorder(BorderFactory.createLineBorder(ColorConst.CONTENT_BACKGROUND));
    jButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    jButton.setPreferredSize(new Dimension(26, 26));
    jButton.setFocusable(false);
  }
}

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

public static JButton createHtmlLinkStyleButton(final URI uri, final String title) {
  final JButton button = new JButton("<html><a href='" + uri + "'>" + title);
  button.setBorderPainted(false);
  button.setOpaque(false);
  button.setBackground(Color.lightGray);
  button.setFocusable(false);
  button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  button.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      final ModeController modeController = Controller.getCurrentModeController();
      final UrlManager urlManager = modeController.getExtension(UrlManager.class);
      urlManager.loadURL(uri);
    }
  });
  return button;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
    downloadsLabel.setText(String.format("<html><a href=\"blank\">%s</a></html>", KENAI_URL + down.getWebLocation().getPath())); //NOI18N
    downloadsLabel.setIcon(ImageUtilities.loadImageIcon("/org/netbeans/modules/kenai/ui/resources/insertlink.png", false)); //NOI18N
    downloadsLabel.setToolTipText(KENAI_URL + down.getWebLocation().getPath());
    downloadsLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    downloadsLabel.removeActionListener(downloadsActionListener);
    downloadsActionListener = new URLListener(down.getWebLocation());
    downloadsLabel.addActionListener(downloadsActionListener);
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
    wwwLabel.setText(String.format("<html><a href=\"blank\">%s</a></html>", KENAI_URL + proj.getWebLocation().getPath())); //NOI18N
    wwwLabel.setIcon(ImageUtilities.loadImageIcon("/org/netbeans/modules/kenai/ui/resources/insertlink.png", false)); //NOI18N
    wwwLabel.setToolTipText(KENAI_URL + proj.getWebLocation().getPath());
    wwwLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    wwwLabel.removeActionListener(wwwActionListener);
    wwwActionListener = new URLListener(proj.getWebLocation());
    wwwLabel.addActionListener(wwwActionListener);
  }
});

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

private void configurarCursorBotoes()
{
  barraFerramentas.setOpaque(false);
  for (Component componente : barraFerramentas.getComponents()) {
    if (componente instanceof JButton) {
      JButton botao = (JButton) componente;
      botao.setOpaque(false);
      botao.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
    wikiLabel.setText(String.format("<html><a href=\"blank\">%s</a></html>", KENAI_URL + wiki.getWebLocation().getPath())); //NOI18N
    wikiLabel.setIcon(ImageUtilities.loadImageIcon("/org/netbeans/modules/kenai/ui/resources/insertlink.png", false)); //NOI18N
    wikiLabel.setToolTipText(KENAI_URL + wiki.getWebLocation().getPath());
    wikiLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    wikiLabel.removeActionListener(wikiActionListener);
    wikiActionListener = new URLListener(wiki.getWebLocation());
    wikiLabel.addActionListener(wikiActionListener);
  }
});

代码示例来源:origin: cytoscape/application

private void setDefaultPanel(final Image defImage, boolean repaint) {
  if (defImage == null)
    return;
  defaultAppearencePanel.removeAll();
  final JButton defaultImageButton = new JButton();
  defaultImageButton.setUI(new BlueishButtonUI());
  defaultImageButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  defaultImageButton.setIcon(new ImageIcon(defImage));
  defaultAppearencePanel.add(defaultImageButton, BorderLayout.CENTER);
  defaultImageButton.addMouseListener(new DefaultMouseListener());
  if ( repaint )
    Cytoscape.getDesktop().repaint();
}

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

@SuppressWarnings({"MethodMayBeStatic"})
protected JButton createOneTouchButton(int dir) {
  JButton b = NapkinUtil.createArrowButton(dir, ARROW_SIZE);
  b.setFocusable(false);
  b.setMinimumSize(new Dimension(SIZE, SIZE));
  b.setCursor(DEFAULT_CURSOR);
  b.setFocusPainted(false);
  b.setBorderPainted(false);
  b.setRequestFocusEnabled(false);
  return b;
}

代码示例来源:origin: huazhouwang/WIFIADB

private void initOthersComponent() {
  final Cursor cursor = Utils.getHandCursor();
  final OnClickAdapter clickAdapter = new CustomClick();
  mConnectButton.setCursor(cursor);
  mHistoryLabel.setCursor(cursor);
  mRefreshLabel.setCursor(cursor);
  mRebootLabel.setCursor(cursor);
  mAddressLabel.setCursor(cursor);
  mHelpLabel.setCursor(cursor);
  mConnectButton.addActionListener(clickAdapter);
  mHistoryLabel.addMouseListener(clickAdapter);
  mRefreshLabel.addMouseListener(clickAdapter);
  mRebootLabel.addMouseListener(clickAdapter);
  mAddressLabel.addMouseListener(clickAdapter);
  mHelpLabel.addMouseListener(clickAdapter);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public kenaiProjectTopComponent(KenaiProject proj) {
  initComponents();
  setName(proj.getDisplayName());
  setToolTipText(NbBundle.getMessage(kenaiProjectTopComponent.class, "HINT_kenaiProjectTopComponent")); //NOI18N
  setIcon(ImageUtilities.loadImage(ICON_PATH, true));
  instProj = proj;
  addSpecificContent();
  proj.getKenai().addPropertyChangeListener(WeakListeners.propertyChange(this, proj.getKenai()));
  mainScrollPane.getVerticalScrollBar().setUnitIncrement(30);
  mainScrollPane.getHorizontalScrollBar().setUnitIncrement(30);
  backToTopLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  backToTopLabel.setBorder(new DottedBorder());
  wwwLabel.setBorder(new DottedBorder());
  wikiLabel.setBorder(new DottedBorder());
  downloadsLabel.setBorder(new DottedBorder());
}

相关文章

JButton类方法