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

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

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

JComponent.setCursor介绍

暂无

代码示例

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

/**
 *  Main constructor to create a ComponentBorder.
 *  @param component the component to be added in the Border area
 *  @param edge  a valid Edge enum of TOP, LEFT, BOTTOM, RIGHT
 *  @param alignment the alignment of the component along the
 *                   specified Edge. Must be in the range 0 - 1.0.
 */
public ComponentBorder(JComponent component, Edge edge, float alignment) {
  this.component = component;
  component.setSize(component.getPreferredSize());
  component.setCursor(Cursor.getDefaultCursor());
  this.setEdge(edge);
  this.setAlignment(alignment);
}

代码示例来源:origin: org.icepdf.os/icepdf-viewer

public void run() {
    pageComponent.setCursor(null);
  }
});

代码示例来源:origin: net.sf.jung/jung-visualization

public void mouseEntered(MouseEvent e) {
  JComponent c = (JComponent)e.getSource();
  c.setCursor(cursor);
}
public void mouseExited(MouseEvent e) {

代码示例来源:origin: jrtom/jung

/** show a special cursor while the mouse is inside the window */
public void mouseEntered(MouseEvent e) {
 JComponent c = (JComponent) e.getSource();
 c.setCursor(cursor);
}

代码示例来源:origin: net.sf.jung/jung-visualization

/**
 * show a special cursor while the mouse is inside the window
 */
public void mouseEntered(MouseEvent e) {
  JComponent c = (JComponent)e.getSource();
  c.setCursor(cursor);
}

代码示例来源:origin: jrtom/jung

/** revert to the default cursor when the mouse leaves this window */
public void mouseExited(MouseEvent e) {
 JComponent c = (JComponent) e.getSource();
 c.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: net.sf.jung/jung-visualization

public void mouseExited(MouseEvent e) {
  JComponent c = (JComponent)e.getSource();
  c.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: net.sf.jung/jung-visualization

/**
 * revert to the default cursor when the mouse leaves this window
 */
public void mouseExited(MouseEvent e) {
  JComponent c = (JComponent)e.getSource();
  c.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: net.sf.jung/jung-visualization

public void mouseExited(MouseEvent e) {
  JComponent c = (JComponent)e.getSource();
  c.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
public void mouseMoved(MouseEvent e) {}

代码示例来源:origin: org.icepdf.os/icepdf-viewer

public void run() {
    if (documentViewController != null)
      pageComponent.setCursor(documentViewController.getViewCursor(
          DocumentViewController.CURSOR_WAIT));
  }
});

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

public void setLinkedObject(OWLObject linkedObject) {
  this.linkedObject = linkedObject;
  if (linkedObject != null) {
    linkedObjectComponent.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  }
  else {
    linkedObjectComponent.getComponent().setCursor(defaultCursor);
  }
}

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

@Override
public void mouseExited(MouseEvent e) {
  if (!this.clicked) {
    this.source.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
  }
  this.source.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}

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

@Override
public void mouseEntered(MouseEvent e) {
  if (!this.clicked) {
    this.source.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, AppThemeColor.ADR_MOUSE_OVER_BORDER));
  }
  this.source.setCursor(this.overCursor);
}

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

public void setLinkedObject(OWLObject linkedObject) {
  this.linkedObject = linkedObject;
  if (linkedObject != null) {
    linkedObjectComponent.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  }
  else {
    linkedObjectComponent.getComponent().setCursor(defaultCursor);
  }
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public void setLinkedObject(OWLObject linkedObject) {
  this.linkedObject = linkedObject;
  if (linkedObject != null) {
    linkedObjectComponent.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  }
  else {
    linkedObjectComponent.getComponent().setCursor(defaultCursor);
  }
}

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

@Override
public boolean mouseMoved (Point p, JComponent component) {
  if (bounds != null && bounds.contains(p)) {
    component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    component.setToolTipText(Bundle.CTL_AnnotationBar_action_showCommit(revision));
    return true;
  }
  return false;
}

代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing

public void customExceptionOccurred(Exception exception)
  {
    AwarenessAgentPanel.this.panel.setCursor(Cursor.getDefaultCursor());
    super.customExceptionOccurred(exception);
  }
});

代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing

public void customResultAvailable(Void result)
{
  AwarenessAgentPanel.this.panel.setCursor(Cursor.getDefaultCursor());
  updateDiscoveryInfos(jtdis);
}
public void customExceptionOccurred(Exception exception)

代码示例来源:origin: com.google.code.findbugs/findbugs

private void removeLink(JComponent component) {
  this.sourceLink = null;
  component.setEnabled(false);
  component.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  component.setToolTipText("");
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

public void drop(DropTargetDropEvent dtde) {
  if (dtde.isDataFlavorSupported(DataFlavor.stringFlavor)) {
    dtde.dropComplete(true);
    if (activeDragItem != null) {
      activeDragItem.dragAccepted();
    }
  } else {
    dtde.rejectDrop();
  }
  component.setCursor(oCursor);
  activeDragItem = null;
  component.repaint();
}

相关文章

JComponent类方法