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); }
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);
/** * 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
/** * 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
private JTextPane createMessagePane(String msg) { JTextPane msgpane = new JTextPane(); msgpane.setEditable(false); msgpane.setFocusable(false); msgpane.setText(msg); return msgpane; }
protected void createLogText() { $objectMap.put("logText", logText = new JTextPane()); logText.setName("logText"); logText.setEditable(false); logText.setFocusable(false); }
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))); } }
text.setFocusable(false); bg.add(text); glassPane.setToolTipText("A tooltip, that shows on both the label and the text");
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; }
pane.setFocusable(true); pane.setText("This is some text. I am making an SSCCE. This is some additional text."); pane.getHighlighter().addHighlight(2, 30,
public static JScrollPane createJTextPane(){ screen = new JTextPane(); screen.setFocusable(false); screen.setEditable(false); screen.setAutoscrolls(true);
testTextArea.setFocusable(true); testTextArea.requestFocusInWindow();
aboutTextPane.setFocusable(false); aboutTextPane.setOpaque(false); aboutTextPane.setEditable(false);
label.setFocusable(false);
instructions.setFocusable(false); instructions.setOpaque(false); jScrollPane1.setViewportView(instructions);
textPane.setFocusable(false); jScrollPane1.setViewportView(textPane);
hintLabel.setBackground(UIManager.getDefaults().getColor("Label.background")); hintLabel.setBorder(null); hintLabel.setFocusable(false);
jErrorMessage.setText(""); jErrorMessage.setEditable(false); jErrorMessage.setFocusable(true); jErrorMessage.setOpaque(false);
inputTextArea.setFocusable(true); inputTextArea.requestFocusInWindow(); inputTextArea.setText(AWPrefs.getDebuggerInputText());
testTextArea.setFocusable(true); testTextArea.requestFocusInWindow(); testTextArea.setText(getTestRigTemplateFromFile(testRigFullPath));