本文整理了Java中javax.swing.JTextPane.setFocusable()
方法的一些代码示例,展示了JTextPane.setFocusable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.setFocusable()
方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:setFocusable
暂无
代码示例来源:origin: org.netbeans.api/org-openide-dialogs
private void prepareMessage(final String msg, final ImageIcon icon, final Color fgColor) {
if( !SwingUtilities.isEventDispatchThread() ) {
SwingUtilities.invokeLater( new Runnable() {
@Override
public void run() {
prepareMessage( msg, icon, fgColor );
}
} );
return;
}
String message = msg;
messagePane.setToolTipText (message);
if (message != null) {
message = message.replaceAll("\\s", " "); // NOI18N
if (! message.toUpperCase().startsWith("<HTML>")) { // NOI18N
message = "<HTML>" + message; // NOI18N
}
}
iconLabel.setIcon(icon);
iconLabel.setForeground(fgColor);
messagePane.setForeground(fgColor);
messagePane.setText(message);
messagePane.setFocusable(message != null);
}
代码示例来源:origin: magefree/mage
lblMessage.setText("long text long text long text long text long text long text long text long text");
lblMessage.setCursor(null);
lblMessage.setFocusable(false);
lblMessage.setOpaque(false);
jScrollPane1.setViewportView(lblMessage);
代码示例来源:origin: magefree/mage
/**
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
scrollPane = new javax.swing.JScrollPane();
text = new javax.swing.JTextPane();
setFocusable(false);
setMinimumSize(new Dimension(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT));
setName("bigCardPanel"); // NOI18N
setOpaque(false);
setPreferredSize(getMinimumSize());
setLayout(null);
scrollPane.setBorder(null);
scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setOpaque(false);
text.setEditable(false);
text.setFocusable(false);
text.setOpaque(false);
scrollPane.setViewportView(text);
add(scrollPane);
scrollPane.setBounds(20, 230, 210, 120);
scrollPane.setBounds(new Rectangle(CONTENT_MAX_XOFFSET, TEXT_MAX_YOFFSET, TEXT_MAX_WIDTH, TEXT_MAX_HEIGHT));
}// </editor-fold>//GEN-END:initComponents
代码示例来源:origin: magefree/mage
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
text = new javax.swing.JTextPane();
setMinimumSize(getPreferredSize());
setOpaque(false);
setPreferredSize(new Dimension(dimension.frameWidth, dimension.frameHeight));
setLayout(null);
jScrollPane1.setBorder(null);
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane1.setFocusable(false);
jScrollPane1.setOpaque(false);
text.setBorder(null);
text.setEditable(false);
text.setFont(new java.awt.Font("Arial", 0, 9));
text.setFocusable(false);
text.setOpaque(false);
jScrollPane1.setViewportView(text);
add(jScrollPane1);
jScrollPane1.setBounds(20, 110, 130, 100);
jScrollPane1.setBounds(new Rectangle(dimension.contentXOffset, dimension.textYOffset, dimension.textWidth, dimension.textHeight));
}// </editor-fold>//GEN-END:initComponents
代码示例来源:origin: com.google.code.findbugs/findbugs
private JTextPane createMessagePane(String msg) {
JTextPane msgpane = new JTextPane();
msgpane.setEditable(false);
msgpane.setFocusable(false);
msgpane.setText(msg);
return msgpane;
}
代码示例来源:origin: fr.ifremer/isis-fish
protected void createLogText() {
$objectMap.put("logText", logText = new JTextPane());
logText.setName("logText");
logText.setEditable(false);
logText.setFocusable(false);
}
代码示例来源:origin: triplea-game/triplea
private void createComponents() {
text = new JTextPane();
text.setEditable(false);
text.setFocusable(false);
nextMessage = new JTextField(10);
// when enter is pressed, send the message
final Insets inset = new Insets(3, 3, 3, 3);
save = new JButton(saveAction);
save.setMargin(inset);
save.setFocusable(false);
for (final PlayerId playerId : data.getPlayerList().getPlayers()) {
Optional.ofNullable(frame.getUiContext().getFlagImageFactory().getSmallFlag(playerId))
.ifPresent(image -> iconMap.put(playerId, new ImageIcon(image)));
}
}
代码示例来源:origin: stackoverflow.com
text.setFocusable(false);
bg.add(text);
glassPane.setToolTipText("A tooltip, that shows on both the label and the text");
代码示例来源:origin: SINTEF-9012/JArduino
public static JScrollPane createJTextPane(){
screen = new JTextPane();
screen.setFocusable(false);
screen.setEditable(false);
screen.setAutoscrolls(true);
JScrollPane editorScrollPane = new JScrollPane(screen);
editorScrollPane.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
editorScrollPane.setPreferredSize(new Dimension(480, 240));
editorScrollPane.setMinimumSize(new Dimension(320, 160));
StyledDocument doc = screen.getStyledDocument();
Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
Random rnd = new Random();
Style receivedigitalReadResultStyle = doc.addStyle("receivedigitalReadResultStyle", def);
StyleConstants.setForeground(receivedigitalReadResultStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
Style receiveanalogReadResultStyle = doc.addStyle("receiveanalogReadResultStyle", def);
StyleConstants.setForeground(receiveanalogReadResultStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
Style receivepongStyle = doc.addStyle("receivepongStyle", def);
StyleConstants.setForeground(receivepongStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
Style receiveinterruptNotificationStyle = doc.addStyle("receiveinterruptNotificationStyle", def);
StyleConstants.setForeground(receiveinterruptNotificationStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
Style receiveeeprom_valueStyle = doc.addStyle("receiveeeprom_valueStyle", def);
StyleConstants.setForeground(receiveeeprom_valueStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
Style receiveeeprom_write_ackStyle = doc.addStyle("receiveeeprom_write_ackStyle", def);
StyleConstants.setForeground(receiveeeprom_write_ackStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
return editorScrollPane;
}
代码示例来源:origin: stackoverflow.com
pane.setFocusable(true);
pane.setText("This is some text. I am making an SSCCE. This is some additional text.");
pane.getHighlighter().addHighlight(2, 30,
代码示例来源:origin: SINTEF-9012/JArduino
public static JScrollPane createJTextPane(){
screen = new JTextPane();
screen.setFocusable(false);
screen.setEditable(false);
screen.setAutoscrolls(true);
代码示例来源:origin: antlr/antlrworks
testTextArea.setFocusable(true);
testTextArea.requestFocusInWindow();
代码示例来源:origin: quanticc/lawena-recording-tool
aboutTextPane.setFocusable(false);
aboutTextPane.setOpaque(false);
aboutTextPane.setEditable(false);
代码示例来源:origin: org.codehaus.izpack/izpack-panel
label.setFocusable(false);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject
instructions.setFocusable(false);
instructions.setOpaque(false);
jScrollPane1.setViewportView(instructions);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject
textPane.setFocusable(false);
jScrollPane1.setViewportView(textPane);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project
hintLabel.setBackground(UIManager.getDefaults().getColor("Label.background"));
hintLabel.setBorder(null);
hintLabel.setFocusable(false);
代码示例来源:origin: GoldenGnu/jeveassets
jErrorMessage.setText("");
jErrorMessage.setEditable(false);
jErrorMessage.setFocusable(true);
jErrorMessage.setOpaque(false);
代码示例来源:origin: antlr/antlrworks
inputTextArea.setFocusable(true);
inputTextArea.requestFocusInWindow();
inputTextArea.setText(AWPrefs.getDebuggerInputText());
代码示例来源:origin: antlr/antlrworks
testTextArea.setFocusable(true);
testTextArea.requestFocusInWindow();
testTextArea.setText(getTestRigTemplateFromFile(testRigFullPath));
内容来源于网络,如有侵权,请联系作者删除!