本文整理了Java中javax.swing.JEditorPane.setCursor()
方法的一些代码示例,展示了JEditorPane.setCursor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JEditorPane.setCursor()
方法的具体详情如下:
包路径:javax.swing.JEditorPane
类名称:JEditorPane
方法名:setCursor
暂无
代码示例来源:origin: JChemPaint/jchempaint
/**
* Follows the reference in an link. The given url is the requested reference.
* By default this calls <a href="#setPage">setPage</a> , and if an exception
* is thrown the original previous document is restored and a beep sounded. If
* an attempt was made to follow a link, but it represented a malformed url,
* this method will be called with a null argument.
*
*@param u the URL to follow
*/
protected void linkActivated(URL u)
{
Cursor c = html.getCursor();
Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
html.setCursor(waitCursor);
SwingUtilities.invokeLater(new PageLoader(u, c));
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation
private void openPane(JEditorPane pane, NavigationCase navCase) {
final Cursor editCursor = pane.getCursor();
pane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
pane.setCaretPosition(navCase.findPosition() + 2);
pane.setCursor(editCursor);
StatusDisplayer.getDefault().setStatusText(""); //NOI18N
}
代码示例来源:origin: com.darwinsys/darwinsys-api
/**
* Notification of a change relative to a hyperlink.
* From: java.swing.event.HyperlinkListener
*/
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
URL target = e.getURL();
// System.out.println("linkto: " + target);
// Get the help panel's cursor and the wait cursor
Cursor oldCursor = help.getCursor();
Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
help.setCursor(waitCursor);
// Now arrange for the page to get loaded asynchronously,
// and the cursor to be set back to what it was.
SwingUtilities.invokeLater(new PageLoader(target, oldCursor));
}
}
代码示例来源:origin: IanDarwin/darwinsys-api
/**
* Notification of a change relative to a hyperlink.
* From: java.swing.event.HyperlinkListener
*/
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
URL target = e.getURL();
// System.out.println("linkto: " + target);
// Get the help panel's cursor and the wait cursor
Cursor oldCursor = help.getCursor();
Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
help.setCursor(waitCursor);
// Now arrange for the page to get loaded asynchronously,
// and the cursor to be set back to what it was.
SwingUtilities.invokeLater(new PageLoader(target, oldCursor));
}
}
代码示例来源:origin: zitmen/thunderstorm
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if(e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
try {
if("jar".equals(e.getURL().getProtocol())) {
htmlBrowser.setPage(e.getURL());
} else {
BrowserLauncher.openURL(e.getURL().toString());
}
} catch(Exception ex) {
IJ.handleException(ex);
}
} else if(e.getEventType() == HyperlinkEvent.EventType.ENTERED) {
htmlBrowser.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
} else if(e.getEventType() == HyperlinkEvent.EventType.EXITED) {
htmlBrowser.setCursor(Cursor.getDefaultCursor());
}
}
});
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) {
commChannelsDisplayer.setToolTipText(e.getDescription());
commChannelsDisplayer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
return;
}
if (e.getEventType() == HyperlinkEvent.EventType.EXITED) {
commChannelsDisplayer.setToolTipText(""); //NOI18N
commChannelsDisplayer.setCursor(Cursor.getDefaultCursor());
return;
}
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
URLDisplayer.getDefault().showURL(e.getURL());
return;
}
}
});
代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit
public void hyperlinkUpdate(HyperlinkEvent evt)
{
if(evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
{
if(evt instanceof HTMLFrameHyperlinkEvent)
{
((HTMLDocument)viewer.getDocument())
.processHTMLFrameHyperlinkEvent(
(HTMLFrameHyperlinkEvent)evt);
historyUpdated();
}
else
{
URL url = evt.getURL();
if(url != null)
{
gotoURL(url.toString(),true,0);
}
}
}
else if (evt.getEventType() == HyperlinkEvent.EventType.ENTERED)
{
viewer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
else if (evt.getEventType() == HyperlinkEvent.EventType.EXITED)
{
viewer.setCursor(Cursor.getDefaultCursor());
}
} //}}}
} //}}}
代码示例来源:origin: javax.help/javahelp
Cursor c = html.getCursor();
Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
html.setCursor(waitCursor);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) {
issuesInfoPane.setToolTipText(e.getDescription());
issuesInfoPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
return;
}
if (e.getEventType() == HyperlinkEvent.EventType.EXITED) {
issuesInfoPane.setToolTipText(""); //NOI18N
issuesInfoPane.setCursor(Cursor.getDefaultCursor());
return;
}
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (e.getDescription().startsWith("issue:")) { //NOI18N
final String issueNumber = e.getDescription().substring(6);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
KenaiIssueAccessor.getDefault().open(instPr, issueNumber);
}
});
return;
}
URLDisplayer.getDefault().showURL(e.getURL());
return;
}
}
});
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui
textPane.getCaret().setVisible(true);
textPane.getCaret().setBlinkRate(0);
textPane.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
setViewportView(textPane);
代码示例来源:origin: com.darwinsys/darwinsys-api
public void run() {
// System.out.println("PageLoader: u=" + url);
if (url == null) {
// restore the original cursor
help.setCursor(cursor);
// PENDING(prinz) remove this hack when
// automatic validation is activated.
Container parent = help.getParent();
parent.repaint();
} else {
Document doc = help.getDocument();
try {
help.setPage(url);
} catch (Exception ioe) {
help.setDocument(doc);
getToolkit().beep();
} finally {
// schedule the cursor to revert after
// the paint has happended.
url = null;
SwingUtilities.invokeLater(this);
}
}
}
}
代码示例来源:origin: IanDarwin/darwinsys-api
public void run() {
// System.out.println("PageLoader: u=" + url);
if (url == null) {
// restore the original cursor
help.setCursor(cursor);
// PENDING(prinz) remove this hack when
// automatic validation is activated.
Container parent = help.getParent();
parent.repaint();
} else {
Document doc = help.getDocument();
try {
help.setPage(url);
} catch (Exception ioe) {
help.setDocument(doc);
getToolkit().beep();
} finally {
// schedule the cursor to revert after
// the paint has happended.
url = null;
SwingUtilities.invokeLater(this);
}
}
}
}
代码示例来源:origin: JChemPaint/jchempaint
html.setCursor(cursor);
代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit
viewer.setCursor(Cursor.getDefaultCursor());
代码示例来源:origin: freeplane/freeplane
@Override
public void mouseMoved(final MouseEvent ev) {
final String link = HtmlUtils.getURLOfExistingLink((HTMLDocument) tip.getDocument(), tip.viewToModel(ev.getPoint()));
boolean followLink = link != null;
Controller currentController = Controller.getCurrentController();
final int requiredCursor;
if(followLink){
currentController.getViewController().out(link);
requiredCursor = Cursor.HAND_CURSOR;
}
else{
requiredCursor = Cursor.DEFAULT_CURSOR;
}
if (tip.getCursor().getType() != requiredCursor) {
tip.setCursor(requiredCursor != Cursor.DEFAULT_CURSOR ? new Cursor(requiredCursor) : null);
}
}
代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-examples-nodes-example7
epEditor.setFont(new java.awt.Font("Courier New", 0, 13));
epEditor.setAutoscrolls(false);
epEditor.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jScrollPane1.setViewportView(epEditor);
代码示例来源:origin: javax.help/javahelp
public void run() {
if (url == null) {
html.setCursor(cursor);
内容来源于网络,如有侵权,请联系作者删除!