jTextPane_nextSentence.setEditable(false); jTextPane_nextSentence.setFont(new java.awt.Font("Tahoma", 0, 24)); jTextPane_nextSentence.setForeground(new java.awt.Color(50, 50, 50)); jTextPane_nextSentence .setText("This is a long and boring test sentence, the only purpose of which is to see how to break between lines without making any difference across the windows.");
jTextPane_nextSentence.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jTextPane_nextSentence.setFont(new java.awt.Font("Tahoma", 0, 24)); jTextPane_nextSentence.setForeground(new java.awt.Color(50, 50, 50)); jTextPane_nextSentence .setText("This is a long and boring test sentence, the only purpose of which is to see how to break between lines without making any difference across the windows.");
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); }
errorPanel.setBorder(BorderFactory.createEmptyBorder(0, 12, 12, 11)); messagePane = new FixedHeightPane (); messagePane.setForeground (nbErrorForeground); iconLabel = new FixedHeightLabel (); errorPanel.add(iconLabel, BorderLayout.LINE_START);
@Override @edu.umd.cs.findbugs.annotations.SuppressWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setResource(final URI resource) { final URI lastResource = SwingSafePbeParametersView.lastResource; if (!lastResource.equals(resource) && !lastResource.equals(SwingSafePbeParametersView.INITIAL_RESOURCE)) { this.resource.setForeground(Color.RED); } else { this.resource.setForeground(defaultForeground); } this.resource.setText(resource.toString()); SwingSafePbeParametersView.lastResource = resource; }
@Override @edu.umd.cs.findbugs.annotations.SuppressWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setResource(final URI resource) { final URI lastResource = SwingSafePbeParametersView.lastResource; if (!lastResource.equals(resource) && !lastResource.equals(SwingSafePbeParametersView.INITIAL_RESOURCE)) { this.resource.setForeground(Color.RED); } else { this.resource.setForeground(defaultForeground); } this.resource.setText(resource.toString()); SwingSafePbeParametersView.lastResource = resource; }
@Override @edu.umd.cs.findbugs.annotations.SuppressWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setResource(final URI resource) { final URI lastResource = SwingSafePbeParametersView.lastResource; if (!lastResource.equals(resource) && !lastResource.equals(SwingSafePbeParametersView.INITIAL_RESOURCE)) { this.resource.setForeground(Color.RED); } else { this.resource.setForeground(defaultForeground); } this.resource.setText(resource.toString()); SwingSafePbeParametersView.lastResource = resource; }
@Override @edu.umd.cs.findbugs.annotations.SuppressWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setResource(final URI resource) { final URI lastResource = SwingSafePbeParametersView.lastResource; if (!lastResource.equals(resource) && !lastResource.equals(SwingSafePbeParametersView.INITIAL_RESOURCE)) { this.resource.setForeground(Color.RED); } else { this.resource.setForeground(defaultForeground); } this.resource.setText(resource.toString()); SwingSafePbeParametersView.lastResource = resource; }
@Override @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setResource(final URI resource) { final @Nullable URI lastResource = view.getLastResource(); if (null != lastResource && !resource.equals(lastResource)) { this.resource.setForeground(Color.RED); } else { this.resource.setForeground(defaultForeground); } this.resource.setText(resource.toString()); view.setLastResource(resource); }
@Override @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setResource(final URI resource) { final @Nullable URI lastResource = view.getLastResource(); if (null != lastResource && !resource.equals(lastResource)) { this.resource.setForeground(Color.RED); } else { this.resource.setForeground(defaultForeground); } this.resource.setText(resource.toString()); view.setLastResource(resource); }
JTextPane createSimplePane() { JTextPane textPane = new JTextPane(); textPane.setMargin(new Insets(1, 1, 1, 1)); textPane.setBackground(Color.WHITE); textPane.setForeground(Color.BLACK); return textPane; }
public WarnaText(JTextPane source) throws BadLocationException { source.setForeground(Color.BLACK); Matcher komen=Pattern.compile("(/\\*([^\\*]|(\\*(?!/))+)*+\\*+/)|(\\/\\/.+)").matcher(source.getText()); while(komen.find()) { StyleContext sc = StyleContext.getDefaultStyleContext(); AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, Color.RED); aset = sc.addAttribute(aset, StyleConstants.FontFamily, "Concolas"); source.select(komen.start(),komen.end()); source.setCharacterAttributes(aset, false); } }
private static Component initConsole() { // TODO: implement possibility to configure the desired log level Logger root = Logger.getLogger(""); JTextPane consoleTextArea = new JTextPane(); JScrollPane consoleScrollPane = new JScrollPane(); consoleScrollPane.setViewportBorder(null); consoleScrollPane.setViewportView(consoleTextArea); consoleTextArea.setEditable(false); consoleTextArea.setBackground(AssetPanel.BACKGROUND); consoleTextArea.setForeground(Color.WHITE); consoleTextArea.setAutoscrolls(true); root.addHandler(new ConsoleLogHandler(consoleTextArea)); return consoleScrollPane; }
private void decorateContent(SwingLayoutTheme layoutTheme) { String contentColor = layoutTheme.findProperty("text-foreground-color"); String contentBackgroundColor = layoutTheme.findProperty("text-background-color"); this.content.setForeground(Color.decode(contentColor)); this.content.setBackground(Color.decode(contentBackgroundColor)); } }
private void decorateDescription(SwingLayoutTheme layoutTheme) { String descriptionColor = layoutTheme.findProperty("text-foreground-color"); this.description.setForeground(Color.decode(descriptionColor)); String descriptionBackgroundColor = layoutTheme.findProperty("text-background-color"); this.description.setBackground(Color.decode(descriptionBackgroundColor)); }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { textPane.setFont(table.getFont()); textPane.setText("\t" + Objects.toString(value, "")); if (isSelected) { textPane.setForeground(table.getSelectionForeground()); panel.setBackground(table.getSelectionBackground()); } else { textPane.setForeground(table.getForeground()); panel.setBackground(table.getBackground()); } panel.add(textPane, BorderLayout.EAST); return panel; } }
private void disableHTML() { messageField.setContentType("text/plain"); final Color color = getStyle(). getBaseValues().getColor(TEXT_COLOR_KEY); messageField.setForeground(color); messageField.setOpaque(false); messageField.setEditable(false); messageField.setEditorKit(new StyledEditorKit()); }
@Override public void run() { if (textPane == null) return; Color foregr = textPane.getForeground(); if ((foregr == null) || (foregr instanceof UIResource)) { textPane .setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceLookAndFeel .getCurrentSkin(textPane) .getEnabledColorScheme( SubstanceLookAndFeel .getDecorationType(textPane)))); } } });
@Override public void contentChanged() { super.contentChanged(); htmlCommit.setForeground(getStyle(). getBaseValues().getColor(Canvas.TEXT_COLOR_KEY)); versionList.setForeground(getStyle(). getBaseValues().getColor(Canvas.TEXT_COLOR_KEY)); }
@Override public void contentChanged() { super.contentChanged(); htmlCommit.setForeground(getStyle(). getBaseValues().getColor(Canvas.TEXT_COLOR_KEY)); versionList.setForeground(getStyle(). getBaseValues().getColor(Canvas.TEXT_COLOR_KEY)); }