本文整理匯總了Java中javax.swing.JEditorPane.setCursor方法的典型用法代碼示例。如果您正苦於以下問題:Java JEditorPane.setCursor方法的具體用法?Java JEditorPane.setCursor怎麽用?Java JEditorPane.setCursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JEditorPane
的用法示例。
在下文中一共展示了JEditorPane.setCursor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ResultPanelOutput
import javax.swing.JEditorPane; //導入方法依賴的package包/類
/**
* Creates a new instance of ResultPanelOutput
*/
ResultPanelOutput(ResultDisplayHandler displayHandler) {
super();
if (LOG) {
System.out.println("ResultPanelOutput.<init>");
}
textPane = new JEditorPane();
textPane.setFont(new Font("monospaced", Font.PLAIN, getFont().getSize()));
textPane.setEditorKit(new OutputEditorKit());
textPane.setEditable(false);
textPane.getCaret().setVisible(true);
textPane.getCaret().setBlinkRate(0);
textPane.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
setViewportView(textPane);
/*
* On GTK L&F, background of the text pane is gray, even though it is
* white on a JTextArea. The following is a hack to fix it:
*/
Color background = UIManager.getColor("TextPane.background"); //NOI18N
if (background != null) {
textPane.setBackground(background);
}
doc = textPane.getDocument();
AccessibleContext ac = textPane.getAccessibleContext();
ac.setAccessibleName(NbBundle.getMessage(getClass(),
"ACSN_OutputTextPane"));//NOI18N
ac.setAccessibleDescription(NbBundle.getMessage(getClass(),
"ACSD_OutputTextPane"));//NOI18N
this.displayHandler = displayHandler;
}