public Console() { super("Console"); JTextPane consoleMessages = new JTextPane(); consoleMessages.setMargin(new Insets(2, 20, 2, 5)); consoleMessages.setFont(Theme.EDITOR_FONT); consoleMessages.setEditable(false);
/** * Create the log pane, with a standard mailbox. */ public LogPane () { // Build the scroll pane component = new JScrollPane(); component.setBorder(null); // log/status area logArea = new JTextPane(); logArea.setEditable(false); logArea.setMargin(new Insets(5, 5, 5, 5)); document = (AbstractDocument) logArea.getStyledDocument(); // Let the scroll pane display the log area component.setViewportView(logArea); }
JTextPane createSimplePane() { JTextPane textPane = new JTextPane(); textPane.setMargin(new Insets(1, 1, 1, 1)); textPane.setBackground(Color.WHITE); textPane.setForeground(Color.BLACK); return textPane; }
protected HashPanel(final String header) { super(new BorderLayout()); setBorder(BorderFactory.createCompoundBorder(BorderFactory .createTitledBorder(header), BorderFactory.createEmptyBorder( 5, 5, 5, 5))); // Text panes -> Comments hashTextPane = new JTextPane(); hashTextPane.putClientProperty("charset", "UTF-8"); hashTextPane.setEditable(false); hashTextPane.setVisible(true); hashTextPane.setFont(new Font("Verdana", Font.BOLD, 10)); hashTextPane.setMargin(new Insets(1, 1, 1, 1)); hashTextPane.setBackground(Color.LIGHT_GRAY); hashTextPane.setForeground(new Color(51, 51, 102)); final JScrollPane hashScrollPane = new JScrollPane(hashTextPane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(hashScrollPane, BorderLayout.CENTER); hashTextPane.setText("Select Alt + Enter to Encode / Alt + Backspace to decode"); }
public LoginPanel(final LoginDialog dialog) { hostTextField.getEmptyText().setText("https://review.example.org"); hostTextField.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { SettingsPanel.fixUrl(hostTextField); } }); DocumentListener listener = new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { dialog.clearErrors(); } }; loginTextField.getDocument().addDocumentListener(listener); passwordField.getDocument().addDocumentListener(listener); gerritLoginInfoTestField.setText(LOGIN_CREDENTIALS_INFO); gerritLoginInfoTestField.setMargin(new Insets(5, 0, 0, 0)); gerritLoginInfoTestField.setBackground(UIUtil.TRANSPARENT_COLOR); }
descriptionField.setMargin(new Insets(2, 2, 2, 2)); descriptionField.setAlignmentX(LEFT_ALIGNMENT); descriptionField.setCaretPosition(0);
public ConsoleFacade(String bannerText) { textPane = new JTextPane(); textPane.setMargin(new Insets(4, 4, 0, 4)); textPane.setCaretColor(new Color(0xa4, 0x00, 0x00)); textPane.setBackground(new Color(0xf2, 0xf2, 0xf2)); textPane.setForeground(new Color(0xa4, 0x00, 0x00)); Font font = findFont("Monospaced", Font.PLAIN, 14, new String[] {"Monaco", "Andale Mono"}); textPane.setFont(font); scrollPane = new JScrollPane(textPane); scrollPane.setDoubleBuffered(true); if ( bannerText != null ) { bannerText = " " + bannerText + " \n\n"; } adaptor = new TextAreaReadline(textPane, bannerText); inputStream = adaptor.getInputStream(); outputStream = new PrintStream(adaptor.getOutputStream()); errorStream = new PrintStream(adaptor.getOutputStream()); }
static void updateMargin(JTextPane textPane) { JViewport viewport = (JViewport) SwingUtilities.getAncestorOfClass(JViewport.class, textPane); if (viewport != null) { Insets margin = textPane.getMargin(); int len = textPane.getDocument().getLength(); try { Rectangle end = textPane.modelToView(len); if (end != null) { margin.bottom = viewport.getHeight() - end.height; textPane.setMargin(margin); } } catch (BadLocationException e) { throw new RuntimeException(e); } } }
text.setText(""); text.setFont( font ); text.setMargin( new Insets(7,5,7,5) ); text.addKeyListener(this); setViewportView(text);
label.setMargin(new Insets(3, 0, 3, 0));
private JTextPane createEditablePane() { JTextPane textPane = new JTextPane(); // Get the preferences for wrapping lines of text final boolean wrapText = JBroFuzz.PREFS.getBoolean( JBroFuzzPrefs.FUZZING[2].getId(), false); if (wrapText) { textPane = new JTextPane(); } else { textPane = new NonWrappingTextPane(); } textPane.putClientProperty("charset", "UTF-8"); textPane.setEditable(true); textPane.setVisible(true); textPane.setFont(new Font("Verdana", Font.PLAIN, 12)); textPane.setMargin(new Insets(1, 1, 1, 1)); textPane.setBackground(Color.WHITE); textPane.setForeground(Color.BLACK); // Set the editor kit responsible for highlighting textPane.setEditorKit(new StyledEditorKit() { private static final long serialVersionUID = -6085642347022880064L; public Document createDefaultDocument() { return new TextHighlighter(); } }); // Right click: Cut, Copy, Paste, Select All RightClickPopups.rightClickRequestTextComponent(this, textPane); return textPane; }
/** * No Arg Constructor. */ public ConsolePanel () { this.setLayout(new BorderLayout()); ta = new JTextPane(); ta.setMargin(new Insets(5, 7, 5, 7)); ta.setEditable(false); ta.setBackground(Color.WHITE); ta.setForeground(Color.BLACK); addStylesToDocument(ta.getStyledDocument()); Font font = new Font("Courier", Font.PLAIN, 12); ta.setFont(font); scrollPane = new JScrollPane(ta); StyledDocument doc = ta.getStyledDocument(); try { doc.insertString(doc.getLength(), "Note: As of January 1, 2008, the " + "cPath plugin will continue to operate, but will no longer be maintained. " + "Users are advised to use the Pathway Commons plugin instead. " + "\n\nTo access the Pathway Commons plugin, select File -> Import -> " + "Network from Web Services, and select the Pathway Commons Web Service." + "\n\n", doc.getStyle("red-bold")); } catch (BadLocationException e) { } add(scrollPane, BorderLayout.CENTER); }
textPaneQuery.setMargin(new Insets(1, 1, 1, 1)); textPaneQuery.setText("Default text");
textPaneQuery.setMargin(new Insets(1, 1, 1, 1)); textPaneQuery.setText("Default text");
editorPane.setBackground(Color.DARK_GRAY); editorPane.setEditable(false); editorPane.setMargin(null);
jtpFontPreview.setEditorKit(kitFontPreview); jtpFontPreview.setDocument(docFontPreview); jtpFontPreview.setMargin(new Insets(4, 4, 4, 4)); jtpFontPreview.setBounds(0, 0, 120, 18); jtpFontPreview.setText(getFontSampleString(defaultText));
_outputPanel.setMargin( new Insets( 10, 10, 10, 10 ) ); _outputPanel.setForeground( Color.white ); _outputPanel.setBackground( Color.black );
_outputPanel.setMargin( new Insets( 10, 10, 10, 10 ) ); _outputPanel.setForeground( new Color( 92, 225, 92 ) ); _outputPanel.setBackground( new Color( 20, 20, 20 ) );
commentPane.setMargin(new Insets(5, 5, 5, 5)); commentPane.setBackground(Lizzie.config.commentBackgroundColor); commentPane.setForeground(Lizzie.config.commentFontColor);