private void jbInit(Reader reader) throws Exception { final Border border = BorderFactory.createEmptyBorder(); jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); tokenPane.setEditable(false); tokenPane.setText(""); scriptPane.setFont(new java.awt.Font("DialogInput", 0, 12)); scriptPane.setEditable(false); scriptPane.setMargin(new Insets(5, 5, 5, 5)); scriptPane.setText(""); jScrollPane1.setBorder(border); jScrollPane2.setBorder(border); jSplitPane1.setMinimumSize(new Dimension(800, 600)); mainPanel.add(jSplitPane1, BorderLayout.CENTER); if (reader == null) { mainPanel.add(jbutton, BorderLayout.NORTH); } this.getContentPane().add(mainPanel); jSplitPane1.add(jScrollPane1, JSplitPane.LEFT); jScrollPane1.getViewport().add(tokenPane, null); jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT); jScrollPane2.getViewport().add(scriptPane, null); jScrollPane1.setColumnHeaderView(new JLabel(" Token Stream:")); jScrollPane2.setColumnHeaderView(new JLabel(" Input Script:")); jSplitPane1.setResizeWeight(0.5); }
/** * Create a new Dialog with a title and a message. * @param message * @param title */ public ErrorDialog(String message, String title) { setTitle(title); setSize(new Dimension(600, 400)); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setLocationRelativeTo(null); Container container = getContentPane(); container.setLayout(new BorderLayout()); JTextArea textArea = new JTextArea(); textArea.setText(message); textArea.setEditable(false); textArea.setMargin(new Insets(PADDING, PADDING, PADDING, PADDING)); add(new JScrollPane(textArea), BorderLayout.CENTER); final JDialog dialog = this; JButton button = new JButton(new AbstractAction("OK"){ @Override public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); add(button, BorderLayout.SOUTH); }
/** * Overridden to update the current line highlight location. * * @param insets The new insets. */ @Override public void setMargin(Insets insets) { Insets old = getInsets(); int oldTop = old!=null ? old.top : 0; int newTop = insets!=null ? insets.top : 0; if (oldTop!=newTop) { // The entire editor will be automatically repainted if it is // visible, so no need to call repaint() or forceCurrentLine...(). previousCaretY = currentCaretY = newTop; } super.setMargin(insets); }
private void setDescriptionTextAreaDesign(final JTextArea jTextArea, final JPanel parentPanel) { jTextArea.setLineWrap(true); jTextArea.setWrapStyleWord(true); jTextArea.setEditable(false); jTextArea.setMargin(new Insets(15, 15, 15, 15)); jTextArea.setBackground(parentPanel.getBackground()); jTextArea.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1)); }
static public void showMessage(String message, int messageType) { backOtherWindows(); JTextArea infoPane = new JTextArea(); infoPane.setEditable(false); infoPane.setMargin(new Insets(5,5,5,5)); infoPane.setLineWrap(true); infoPane.setWrapStyleWord(true); infoPane.setText(message); infoPane.setColumns(60); JScrollPane scrollPane = new JScrollPane(infoPane); scrollPane.setPreferredSize(new Dimension(400, 200)); JOptionPane.showMessageDialog(getCurrentRootComponent(), scrollPane, "Freeplane", messageType); } public static int showConfirmDialog(final NodeModel node, final Object message, final String title,
/** * Overridden to update the current line highlight location. * * @param insets The new insets. */ @Override public void setMargin(Insets insets) { Insets old = getInsets(); int oldTop = old!=null ? old.top : 0; int newTop = insets!=null ? insets.top : 0; if (oldTop!=newTop) { // The entire editor will be automatically repainted if it is // visible, so no need to call repaint() or forceCurrentLine...(). previousCaretY = currentCaretY = newTop; } super.setMargin(insets); }
protected JTextArea getDescriptionPane() { if (this.textArea == null) { this.textArea = new JTextArea( getDescription()); this.textArea.setMargin(new Insets(10, 10, 10, 10)); this.textArea.setWrapStyleWord(true); this.textArea.setLineWrap(true); this.textArea.setEditable(false); this.textArea.setBackground(Color.WHITE); this.textArea.setOpaque(true); } return this.textArea; }
public CToolTipUI(Color background) { super(); this.background = background; renderer = new CellRendererPane(); textArea = new JTextArea(); textArea.setMargin(new Insets(0, 3, 0, 0)); renderer.removeAll(); renderer.add(textArea); textArea.setFont(new Font("Ariel", Font.PLAIN, 11)); textArea.setWrapStyleWord(true); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); }
public GUIAlignmentProgressListener(){ super(new BorderLayout()); stopButton = new JButton("Stop"); stopButton.setActionCommand("Stop"); stopButton.addActionListener(this); progressBar = new JProgressBar(0, 100); progressBar.setValue(0); progressBar.setStringPainted(true); taskOutput = new JTextArea(5, 20); taskOutput.setMargin(new Insets(5,5,5,5)); taskOutput.setEditable(false); JPanel panel = new JPanel(); panel.add(stopButton); panel.add(progressBar); add(panel, BorderLayout.PAGE_START); add(new JScrollPane(taskOutput), BorderLayout.CENTER); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); }
public static JPanel getPropertyPanel(String displayName, Component inputComponent) { JPanel result = new JPanel(); result.setLayout(new BorderLayout()); JPanel messagePanel = new JPanel(new BorderLayout()); messagePanel.setBorder(new EmptyBorder(5, 5, 0, 0)); messagePanel.setBackground(WHITE); result.add(messagePanel, NORTH); JLabel inputLabel = new JLabel("Enter a value for the annotation"); inputLabel.setBackground(WHITE); Font baseFont = inputLabel.getFont(); inputLabel.setFont(baseFont.deriveFont(BOLD)); messagePanel.add(inputLabel, NORTH); JTextArea messageText = new JTextArea(format( "Enter a value for the annotation '%s'", displayName)); messageText.setMargin(new Insets(5, 10, 10, 10)); messageText.setMinimumSize(new Dimension(0, 30)); messageText.setFont(baseFont.deriveFont(11f)); messageText.setEditable(false); messageText.setFocusable(false); messagePanel.add(messageText, CENTER); result.add(new JScrollPane(inputComponent), CENTER); return result; } }
public static JPanel getPropertyPanel(String displayName, Component inputComponent) { JPanel result = new JPanel(); result.setLayout(new BorderLayout()); JPanel messagePanel = new JPanel(new BorderLayout()); messagePanel.setBorder(new EmptyBorder(5, 5, 0, 0)); messagePanel.setBackground(WHITE); result.add(messagePanel, NORTH); JLabel inputLabel = new JLabel("Enter a value for the annotation"); inputLabel.setBackground(WHITE); Font baseFont = inputLabel.getFont(); inputLabel.setFont(baseFont.deriveFont(BOLD)); messagePanel.add(inputLabel, NORTH); JTextArea messageText = new JTextArea(format( "Enter a value for the annotation '%s'", displayName)); messageText.setMargin(new Insets(5, 10, 10, 10)); messageText.setMinimumSize(new Dimension(0, 30)); messageText.setFont(baseFont.deriveFont(11f)); messageText.setEditable(false); messageText.setFocusable(false); messagePanel.add(messageText, CENTER); result.add(new JScrollPane(inputComponent), CENTER); return result; } }
private static final long serialVersionUID = 1L; public Note() { createContent(); // add this line into your code. int x = 400; int y = 300; this.setSize(new Dimension(x, y)); this.setTitle("Post-It Note"); this.setVisible(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public JScrollPane createContent(){ Color textAreaColor = new Color(248, 247, 235); JTextArea textArea = new JTextArea(); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.setBorder(null); textArea.setBackground(textAreaColor); scrollPane.setBackground(textAreaColor); textArea.setMargin(new Insets(10, 15, 20, 20)); this.add(scrollPane, BorderLayout.CENTER); return null; } public static void main(String[] args) { new Note(); // mainWindow.createContent(); comment this line... }
changelog.setColumns(87); changelog.setRows(30); changelog.setMargin(new Insets(5, 5, 5, 5));
private void jbInit() throws Exception{ border1 = BorderFactory.createEmptyBorder(); border2 = BorderFactory.createEmptyBorder(); jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); tokenPane.setEditable(false); tokenPane.setText(""); scriptPane.setFont(new java.awt.Font("DialogInput", 0, 12)); scriptPane.setEditable(false); scriptPane.setMargin(new Insets(5, 5, 5, 5)); scriptPane.setText(""); jScrollPane1.setBorder(border1); jScrollPane2.setBorder(border1); jSplitPane1.setMinimumSize(new Dimension(800,600)); mainPanel.add(jSplitPane1, BorderLayout.CENTER); mainPanel.add(jbutton,BorderLayout.NORTH); this.getContentPane().add(mainPanel); jSplitPane1.add(jScrollPane1, JSplitPane.LEFT); jScrollPane1.getViewport().add(tokenPane, null); jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT); jScrollPane2.getViewport().add(scriptPane, null); jScrollPane1.setColumnHeaderView(new JLabel(" Token Stream:")); jScrollPane2.setColumnHeaderView(new JLabel(" Input Script:")); jSplitPane1.setResizeWeight(0.5); }
private void jbInit() throws Exception{ border1 = BorderFactory.createEmptyBorder(); border2 = BorderFactory.createEmptyBorder(); jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); tokenPane.setEditable(false); tokenPane.setText(""); scriptPane.setFont(new java.awt.Font("DialogInput", 0, 12)); scriptPane.setEditable(false); scriptPane.setMargin(new Insets(5, 5, 5, 5)); scriptPane.setText(""); jScrollPane1.setBorder(border1); jScrollPane2.setBorder(border1); jSplitPane1.setMinimumSize(new Dimension(800,600)); mainPanel.add(jSplitPane1, BorderLayout.CENTER); mainPanel.add(jbutton,BorderLayout.NORTH); this.getContentPane().add(mainPanel); jSplitPane1.add(jScrollPane1, JSplitPane.LEFT); jScrollPane1.getViewport().add(tokenPane, null); jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT); jScrollPane2.getViewport().add(scriptPane, null); jScrollPane1.setColumnHeaderView(new JLabel(" Token Stream:")); jScrollPane2.setColumnHeaderView(new JLabel(" Input Script:")); jSplitPane1.setResizeWeight(0.5); }
private void jbInit() throws Exception{ border1 = BorderFactory.createEmptyBorder(); border2 = BorderFactory.createEmptyBorder(); jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); tokenPane.setEditable(false); tokenPane.setText(""); scriptPane.setFont(new java.awt.Font("DialogInput", 0, 12)); scriptPane.setEditable(false); scriptPane.setMargin(new Insets(5, 5, 5, 5)); scriptPane.setText(""); jScrollPane1.setBorder(border1); jScrollPane2.setBorder(border1); jSplitPane1.setMinimumSize(new Dimension(800,600)); mainPanel.add(jSplitPane1, BorderLayout.CENTER); mainPanel.add(jbutton,BorderLayout.NORTH); this.getContentPane().add(mainPanel); jSplitPane1.add(jScrollPane1, JSplitPane.LEFT); jScrollPane1.getViewport().add(tokenPane, null); jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT); jScrollPane2.getViewport().add(scriptPane, null); jScrollPane1.setColumnHeaderView(new JLabel(" Token Stream:")); jScrollPane2.setColumnHeaderView(new JLabel(" Input Script:")); jSplitPane1.setResizeWeight(0.5); }
private void jbInit() throws Exception{ border1 = BorderFactory.createEmptyBorder(); border2 = BorderFactory.createEmptyBorder(); jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); tokenPane.setEditable(false); tokenPane.setText(""); scriptPane.setFont(new java.awt.Font("DialogInput", 0, 12)); scriptPane.setEditable(false); scriptPane.setMargin(new Insets(5, 5, 5, 5)); scriptPane.setText(""); jScrollPane1.setBorder(border1); jScrollPane2.setBorder(border1); jSplitPane1.setMinimumSize(new Dimension(800,600)); mainPanel.add(jSplitPane1, BorderLayout.CENTER); mainPanel.add(jbutton,BorderLayout.NORTH); this.getContentPane().add(mainPanel); jSplitPane1.add(jScrollPane1, JSplitPane.LEFT); jScrollPane1.getViewport().add(tokenPane, null); jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT); jScrollPane2.getViewport().add(scriptPane, null); jScrollPane1.setColumnHeaderView(new JLabel(" Token Stream:")); jScrollPane2.setColumnHeaderView(new JLabel(" Input Script:")); jSplitPane1.setResizeWeight(0.5); }
/*** * Function to initialized components */ private void initComponents() { setSize(toasterWidth, toasterHeight); message.setFont(getToasterMessageFont()); JPanel externalPanel = new JPanel(new BorderLayout(1, 1)); externalPanel.setBackground(getBorderColor()); JPanel innerPanel = new JPanel(new BorderLayout(getMargin(), getMargin())); innerPanel.setBackground(getToasterColor()); message.setBackground(getToasterColor()); message.setMargin(new Insets(2, 2, 2, 2)); message.setLineWrap(true); message.setWrapStyleWord(true); EtchedBorder etchedBorder = (EtchedBorder) BorderFactory.createEtchedBorder(); externalPanel.setBorder(etchedBorder); externalPanel.add(innerPanel); message.setForeground(getMessageColor()); innerPanel.add(iconLabel, BorderLayout.WEST); innerPanel.add(message, BorderLayout.CENTER); getContentPane().add(externalPanel); }
/** * Create a new Dialog with a title and a message. * @param message * @param title */ public ErrorDialog(String message, String title) { setTitle(title); setSize(new Dimension(600, 400)); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setLocationRelativeTo(null); Container container = getContentPane(); container.setLayout(new BorderLayout()); JTextArea textArea = new JTextArea(); textArea.setText(message); textArea.setEditable(false); textArea.setMargin(new Insets(PADDING, PADDING, PADDING, PADDING)); add(new JScrollPane(textArea), BorderLayout.CENTER); final JDialog dialog = this; JButton button = new JButton(new AbstractAction("OK"){ @Override public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); add(button, BorderLayout.SOUTH); }