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

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

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

JLabel.setCursor介绍

暂无

代码示例

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

JLabel label = new JLabel("<HTML><U>YOUR TEXT HERE</U></HTML>");
label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

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

JLabel label = new JLabel("http://stackoverflow.com");
label.setCursor(new Cursor(Cursor.HAND_CURSOR));

代码示例来源:origin: deathmarine/Luyten

String project = "https://github.com/deathmarine/Luyten/";
JLabel link = new JLabel("<HTML><FONT color=\"#000099\"><U>" + project + "</U></FONT></HTML>");
link.setCursor(new Cursor(Cursor.HAND_CURSOR));
link.addMouseListener(new LinkListener(project, link));
pane.add(link);
String procyon = "https://bitbucket.org/mstrobel/procyon";
link = new JLabel("<HTML><FONT color=\"#000099\"><U>" + procyon + "</U></FONT></HTML>");
link.setCursor(new Cursor(Cursor.HAND_CURSOR));
link.addMouseListener(new LinkListener(procyon, link));
pane.add(link);
String rsyntax = "https://github.com/bobbylight/RSyntaxTextArea";
link = new JLabel("<HTML><FONT color=\"#000099\"><U>" + rsyntax + "</U></FONT></HTML>");
link.setCursor(new Cursor(Cursor.HAND_CURSOR));
link.addMouseListener(new LinkListener(rsyntax, link));
pane.add(link);

代码示例来源:origin: deathmarine/Luyten

final String issue = "https://github.com/deathmarine/Luyten/issues";
final JLabel link = new JLabel("<HTML>Submit to <FONT color=\"#000099\"><U>" + issue + "</U></FONT></HTML>");
link.setCursor(new Cursor(Cursor.HAND_CURSOR));
link.addMouseListener(new MouseAdapter() {
  @Override

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

linkText.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
linkText.addMouseListener(new MouseAdapter() {
  public void mouseClicked (MouseEvent e) {

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

assert ml != null;
c.setText(htmlIfy(linkIfy(c.getText())));
c.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
c.addMouseListener(ml);

代码示例来源:origin: RipMeApp/ripme

configSaveDirLabel.setText(workingDir);
  configSaveDirLabel.setForeground(Color.BLUE);
  configSaveDirLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
} catch (Exception e) { }
configSaveDirLabel.setToolTipText(configSaveDirLabel.getText());

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

import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.EventQueue;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

  private void goWebsite(JLabel website, final String url, String text) {
    website.setText("<html> Website : <a href=\"\">"+text+"</a></html>");
    website.setCursor(new Cursor(Cursor.HAND_CURSOR));
    website.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
          try {
              Desktop.getDesktop().browse(new URI(url));
          } catch (URISyntaxException | IOException ex) {
              //It looks like there's a problem
          }
      }
    });
  }

代码示例来源:origin: apache/pdfbox

public ReaderBottomPanel()
{
  BorderLayout layout = new BorderLayout();
  this.setLayout(layout);
  
  statusLabel = new JLabel();
  statusLabel.setText("Ready");
  this.add(statusLabel, BorderLayout.WEST);
  logLabel = new JLabel();
  logLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
  logLabel.addMouseListener(new MouseAdapter()
  {
    @Override
    public void mouseClicked(MouseEvent e)
    {
      Window viewer = LogDialog.instance().getOwner();
      
      // show the log window
      LogDialog.instance().setSize(800, 400);
      LogDialog.instance().setVisible(true);
      LogDialog.instance().setLocation(viewer.getLocationOnScreen().x + viewer.getWidth() / 2,
                       viewer.getLocationOnScreen().y + viewer.getHeight() / 2);
    }
  });
  this.add(logLabel, BorderLayout.EAST);
  this.setBorder(new EmptyBorder(0, 5, 0, 5));
  this.setPreferredSize(new Dimension(1000, 24));
}

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

lblCount.setText("999");
lblCount.setToolTipText("Number of all cards in this area.");
lblCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblCount.setFocusable(false);
lblCount.setInheritsPopupMenu(false);
lblLandCount.setToolTipText("Number of lands.");
lblLandCount.setVerticalAlignment(javax.swing.SwingConstants.TOP);
lblLandCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblLandCount.setFocusable(false);
lblLandCount.setInheritsPopupMenu(false);
lblCreatureCount.setToolTipText("Number of creatures.");
lblCreatureCount.setVerticalAlignment(javax.swing.SwingConstants.TOP);
lblCreatureCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblCreatureCount.setFocusable(false);
lblCreatureCount.setInheritsPopupMenu(false);

代码示例来源:origin: ron190/jsql-injection

ComponentBorder loaderInTextfield = new ComponentBorder(this.loader, 17, 1);
loaderInTextfield.install(this.textFieldAddress);
this.loader.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));

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

@Override
  public void mouseExited(MouseEvent e) {
    label.setCursor(oldCursor);
  }
@Override

代码示例来源:origin: winder/Universal-G-Code-Sender

remainingRowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
remainingRowsLabel.setMaximumSize(null);
remainingRowsLabel.setMinimumSize(new java.awt.Dimension(106, 14));
sentRowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
sentRowsLabel.setMaximumSize(null);
sentRowsLabel.setMinimumSize(new java.awt.Dimension(106, 14));
rowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
rowsLabel.setMinimumSize(new java.awt.Dimension(106, 14));
rowsLabel.setPreferredSize(new java.awt.Dimension(106, 14));

代码示例来源:origin: datacleaner/DataCleaner

private JComponent createResetSearchButton() {
  final JLabel resetSearchFieldIcon = new JLabel("X");
  resetSearchFieldIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  resetSearchFieldIcon.setBorder(WidgetUtils.BORDER_EMPTY);
  resetSearchFieldIcon.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseReleased(final MouseEvent e) {
      resetSearch();
    }
  });
  return resetSearchFieldIcon;
}

代码示例来源:origin: igniterealtime/Spark

public void mouseExited(MouseEvent e) {
    titleLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  }
});

代码示例来源:origin: net.preibisch/multiview-reconstruction

@Override
public void mouseEntered( final MouseEvent e )
{
  linkLabel.setForeground( Color.BLUE );
  linkLabel.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
}

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

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

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JLabel createIconButton(ImageIcon i) {
  JLabel b = new JLabel();
  b.setBorder(null);
  b.setOpaque(false);
  b.setPreferredSize(new Dimension(i.getIconWidth(), i.getIconHeight()));
  b.setCursor(new Cursor(Cursor.HAND_CURSOR));
  b.setIcon(i);
  return b;
}

代码示例来源:origin: com.github.stephenc.monte/monte-screen-recorder

public void setLabel(JLabel newValue) {
  if (label != null) {
    label.removeMouseListener(handler);
    label.removeMouseMotionListener(handler);
    label.setCursor(Cursor.getDefaultCursor());
  }
  label = newValue;
  if (label != null) {
    label.addMouseListener(handler);
    label.addMouseMotionListener(handler);
  }
}

代码示例来源:origin: com.synaptix/SynaptixSwing

private void initComponents() {
  createComponents();
  label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  label.addMouseListener(new LabelMouseListener());
  label.setToolTipText(SwingMessages.getString("JDateHourTextField.2")); //$NON-NLS-1$
  popupMenu.add(buildEditorPanel());
  popupMenu.pack();
  this.add(label);
  this.addComponentListener(new DateTextFieldComponentListener());
}

相关文章

微信公众号

最新文章

更多

JLabel类方法