JTextArea area = new JTextArea("hello world"); area.setForeground(Color.red)
adhocMessages.setForeground(new Color(1, 94, 35)); tabbedPane.add("Ad-hoc message", new JScrollPane(adhocMessages)); tabbedPane.setToolTipTextAt(3, "Panel that allows you to send adhoc packets");
sentText1.setEditable(false); sentText2.setEditable(false); sentText1.setForeground(new Color(112, 3, 3)); sentText2.setForeground(new Color(112, 3, 3)); allPane.add(new JScrollPane(sentText1)); tabbedPane.add("Sent", new JScrollPane(sentText2)); receivedText1.setEditable(false); receivedText2.setEditable(false); receivedText1.setForeground(new Color(6, 76, 133)); receivedText2.setForeground(new Color(6, 76, 133)); allPane.add(new JScrollPane(receivedText1)); tabbedPane.add("Received", new JScrollPane(receivedText2)); interpretedText1.setForeground(new Color(1, 94, 35)); interpretedText2.setForeground(new Color(1, 94, 35)); allPane.add(new JScrollPane(interpretedText1)); tabbedPane.add("Interpreted", new JScrollPane(interpretedText2));
sentText.setLineWrap(true); sentText.setEditable(false); sentText.setForeground(new Color(112, 3, 3)); tabbedPane.add("Raw Sent Packets", new JScrollPane(sentText)); tabbedPane.setToolTipTextAt(1, "Raw text of the sent packets"); receivedText.setLineWrap(true); receivedText.setEditable(false); receivedText.setForeground(new Color(6, 76, 133)); tabbedPane.add("Raw Received Packets", new JScrollPane(receivedText)); tabbedPane.setToolTipTextAt(
status.setForeground(Color.BLUE);
private void setForegroundColor(Color color) { if (numberLabel != null) { numberLabel.setForeground(color); numberLabel.setBackground(color); } ta.setForeground(color); } }
JTextArea txt = new JTextArea(); Font font = new Font("Verdana", Font.BOLD, 12); txt.setFont(font); txt.setForeground(Color.BLUE);
public boolean validate() { WKTReader reader = new WKTReader(); String wkt = text.getText(); if (wkt.length() == 0) { return true; } try { Geometry geom = reader.read(wkt); if (parameter.type.isInstance(geom)) { text.setToolTipText(null); text.setForeground(Color.BLACK); return true; } else { text.setToolTipText("Could not use " + geom.getClass() + " as " + parameter.type); text.setForeground(Color.RED); return false; } } catch (Throwable eek) { text.setToolTipText(eek.getLocalizedMessage()); text.setForeground(Color.RED); return false; } } }
@Override public void focusGained(FocusEvent e) { commentBox.setForeground(null); commentBox.setFont(plainCommentFont); if (isDefaultComment(commentBox.getText())) { resetCommentBoxFont(); setCommentText(""); } }
public JTextArea getSimpleTextArea(String text) { JTextArea area = new JTextArea(text); area.setEditable(false); area.setWrapStyleWord(true); area.setLineWrap(true); area.setBackground(AppThemeColor.TRANSPARENT); area.setBorder(null); area.setFont(REGULAR_FONT.deriveFont(scale * 16f)); area.setForeground(AppThemeColor.TEXT_DEFAULT); return area; }
private void clearErrorMessage() { messageLabel.setText(""); messageLabel.setForeground(null); annotationContent.setToolTipText(null); annotationContent.setForeground(null); }
private void setDefaultComment(String defaultComment) { setCommentText(defaultComment); commentBox.setForeground(Color.DARK_GRAY); commentBox.setFont(plainCommentFont.deriveFont(Font.ITALIC)); }
private void reportError(String msg) { JTextArea infoArea = variablesCsvUi.getCheckInfoTextArea(); infoArea.setText(infoArea.getText() + "Problem detected: " + msg + "\n"); infoArea.setForeground(Color.red); }
@Override public void mouseExited(final MouseEvent e) { _bodyLabel.setForeground(COLOR_NORMAL); setBorder(_normalBorder); } };
private void reportError(String msg) { JTextArea infoArea = variablesCsvUi.getCheckInfoTextArea(); infoArea.setText(infoArea.getText() + "Problem detected: " + msg + "\n"); infoArea.setForeground(Color.red); }
private void displayException(Exception exc) { _returnPane.setBorder(BorderFactory.createTitledBorder(RETURNED_EXCEPTION)); _returnArea.setForeground(Color.RED); _returnArea.setText(ReturnFormatter.formatException(exc)); _returnArea.setCaretPosition(0); } }
/** * This is called when the input color is changed so that all input is added with the * AttributeSet (Style) that has been specified for input. */ private void setInputAttribute() { inputControl.setInputAttributeSet(consoleStyledDocument.getStyle(inputColor)); if (!useInlineInput) { inputArea.setForeground(getStyleColorFromCode(inputColor.charAt(0))); // Foreground inputArea.setBackground(getStyleColorFromCode(inputColor.charAt(1))); // Background } }
private void doSetMessage(final IMessage message) { try { this.messageTitleLabel.setForeground(MessageUI.getColor(message)); this.messageTitleLabel.setText(message.getText()); this.messageTypeLabel.setIcon(MessageUI.getIcon(message, getIcon())); this.messageTextArea.setForeground(MessageUI.getColor(message)); this.messageDocument.replace(0, this.messageDocument.getLength(), message.getDescription(), null); } catch (final Exception exception) { // TODO_NOW: handle exception } }
private void setForegroundColors() { preview.setForeground(themeData.getColor(ThemeData.EDITOR_FOREGROUND_COLOR)); preview.setCaretColor(themeData.getColor(ThemeData.EDITOR_FOREGROUND_COLOR)); preview.setSelectedTextColor(themeData.getColor(ThemeData.EDITOR_SELECTED_FOREGROUND_COLOR)); }
private void setForegroundColors() { shellPreview.setForeground(themeData.getColor(ThemeData.SHELL_FOREGROUND_COLOR)); shellPreview.setSelectedTextColor(themeData.getColor(ThemeData.SHELL_SELECTED_FOREGROUND_COLOR)); shellPreview.setCaretColor(themeData.getColor(ThemeData.SHELL_FOREGROUND_COLOR)); historyPreview.setForeground(themeData.getColor(ThemeData.SHELL_HISTORY_FOREGROUND_COLOR)); historyPreview.setSelectionForeground(themeData.getColor(ThemeData.SHELL_HISTORY_SELECTED_FOREGROUND_COLOR)); }