Refine search
private JComponent getCenterPanel() { JPanel center = new JPanel(new BorderLayout()); center.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); center.setBackground(Color.WHITE); JTextArea license = new javax.swing.JTextArea(); license.setLineWrap(true); license.setWrapStyleWord(true); license.setEditable(false); license.setFont(license.getFont().deriveFont(11.0f)); StringBuilder licenseText = new StringBuilder(); licenseText.append("Enhance current Java (JRE/JDK) installations with DCEVM (http://github.com/dcevm/dcevm)."); licenseText.append("\n\nYou can either replace current Java VM or install DCEVM as alternative JVM (run with -XXaltjvm=dcevm command-line option)."); licenseText.append("\nInstallation as alternative JVM is preferred, it gives you more control where you will use DCEVM.\nWhy this is important? Because DCEVM forces your JVM to use only one GC algorithm, and this may cause performance penalty."); licenseText.append("\n\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation.\n\nThis code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code).\n\nYou should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA."); licenseText.append("\n\n\nASM LICENSE TEXT:\nCopyright (c) 2000-2005 INRIA, France Telecom\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."); license.setText(licenseText.toString()); JScrollPane licenses = new JScrollPane(license, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); licenses.setPreferredSize(new Dimension(150, 150)); center.add(licenses, BorderLayout.NORTH); center.add(getChooserPanel(), BorderLayout.CENTER); return center; }
@Override public void run() { errorWindow.getContentPane().removeAll(); JTextArea textArea = new JTextArea(); textArea.setEditable(false); StringBuilder text = new StringBuilder(); text.append("An exceptional error occurred!\nYou can try to continue or exit the application.\n\n"); text.append("Please tell us about this here:\nhttp://www.4thline.org/projects/mailinglists-cling.html\n\n"); text.append("-------------------------------------------------------------------------------------------------------------\n\n"); Writer stackTrace = new StringWriter(); throwable.printStackTrace(new PrintWriter(stackTrace)); text.append(stackTrace.toString()); textArea.setText(text.toString()); JScrollPane pane = new JScrollPane(textArea); errorWindow.getContentPane().add(pane, BorderLayout.CENTER); JButton exitButton = new JButton("Exit Application"); exitButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.exit(1); } }); errorWindow.getContentPane().add(exitButton, BorderLayout.SOUTH); errorWindow.pack(); Application.center(errorWindow); textArea.setCaretPosition(0); errorWindow.setVisible(true); } });
private void init() { JTextArea errorArea = new JTextArea(); errorArea.setEditable(false); errorArea.setText(exc.getMessage() + "\n"); getContentPane().setLayout(new BorderLayout()); JPanel messagePanel = new JPanel(new BorderLayout()); messagePanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory .createTitledBorder(BorderFactory.createEtchedBorder(), NLS.nls("COMPILE_ERROR.PANEL.TITLE")))); messagePanel.add(new JScrollPane(errorArea), BorderLayout.CENTER); getContentPane().add(messagePanel, BorderLayout.CENTER); JPanel btnPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); okBtn = new JButton(NLS.nls("COMPILE_ERROR.OK_BUTTON.CAPTION")); okBtn.addActionListener(this); btnPane.add(okBtn); getRootPane().setDefaultButton(okBtn); getContentPane().add(btnPane, BorderLayout.SOUTH); pack(); setLocationRelativeTo(getParent()); setVisible(true); }
public AboutDialog(JFrame parent) { this.setResizable(false); this.setSize(new Dimension(400, 250)); this.getContentPane().setLayout(new BorderLayout(0, 0)); JLabel lblResizer = new JLabel(Localization.get("app_name") + " " + Configuration.getVersion()); lblResizer.setBorder(new EmptyBorder(10, 10, 10, 10)); lblResizer.setVerticalTextPosition(SwingConstants.BOTTOM); lblResizer.setIconTextGap(10); lblResizer.setFont(lblResizer.getFont().deriveFont( lblResizer.getFont().getStyle() | Font.BOLD, 16f)); lblResizer.setIcon(new ImageIcon(AboutDialog.class .getResource("/img/icon_64.png"))); this.getContentPane().add(lblResizer, BorderLayout.NORTH); JTextArea txtrResizerIsA = new JTextArea(); txtrResizerIsA.setEditable(false); txtrResizerIsA.setWrapStyleWord(true); txtrResizerIsA.setBorder(new EmptyBorder(0, 10, 10, 10)); txtrResizerIsA.setFont(UIManager.getFont("Label.font")); txtrResizerIsA.setLineWrap(true); txtrResizerIsA.setText(Localization.get("about_text")); txtrResizerIsA.setBackground(new Color(0, 0, 0, 0)); this.getContentPane().add(txtrResizerIsA, BorderLayout.CENTER); this.setLocationRelativeTo(parent); }
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); }
private JPanel createMiddlePanel() { middlePanel = new JPanel(new CardLayout()); JPanel usageExplanationPanel = new JPanel(new BorderLayout(5, 5)); ImageIcon usageExplanationIcon = new ImageIcon(getClass().getResource(solutionPanel.getUsageExplanationPath())); JLabel usageExplanationLabel = new JLabel(usageExplanationIcon); // Allow splitPane divider to be moved to the right usageExplanationLabel.setMinimumSize(new Dimension(100, 100)); usageExplanationPanel.add(usageExplanationLabel, BorderLayout.CENTER); JPanel descriptionPanel = new JPanel(new BorderLayout(2, 2)); descriptionPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); descriptionPanel.add(new JLabel("Example description"), BorderLayout.NORTH); JTextArea descriptionTextArea = new JTextArea(8, 70); descriptionTextArea.setEditable(false); descriptionTextArea.setText(solutionBusiness.getAppDescription()); descriptionPanel.add(new JScrollPane(descriptionTextArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER); usageExplanationPanel.add(descriptionPanel, BorderLayout.SOUTH); middlePanel.add(usageExplanationPanel, "usageExplanationPanel"); JComponent wrappedSolutionPanel; if (solutionPanel.isWrapInScrollPane()) { wrappedSolutionPanel = new JScrollPane(solutionPanel); } else { wrappedSolutionPanel = solutionPanel; } middlePanel.add(wrappedSolutionPanel, "solutionPanel"); return middlePanel; }
/** * 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); }
if (message.contains("\n")) { for (String s : message.split("\n")) { pane.add(new JLabel(s)); pane.add(new JLabel(message)); pane.add(new JLabel(" \n")); // Whitespace final JTextArea exception = new JTextArea(25, 100); exception.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 10)); exception.setText(stacktrace); exception.addMouseListener(new MouseAdapter() { @Override
private JPanel getTriggerTypePanel() { final JPanel triggerOuterPanel = new VerticalPanel(50, 0.0F); triggerOuterPanel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Commands triggered by")); final JPanel triggerPanel = new JPanel(new BorderLayout(10, 50)); setDescriptionTextAreaDesign(triggerTypeDescription, triggerPanel); triggerPanel.add(triggerType, BorderLayout.LINE_START); triggerPanel.add(triggerTypeDescription, BorderLayout.CENTER); triggerType.addActionListener(e -> triggerTypeDescription.setText(getDescriptionTextForSelectedTrigger())); triggerOuterPanel.add(triggerPanel); return triggerOuterPanel; }
getRootPane().add(panel, BorderLayout.CENTER); JTextArea params = new JTextArea(); params.setText(getParameters()); params.setEditable(false); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.insets = new Insets(5, 5, 5, 5); panel.add(params, c); c.gridy = 1; c.insets = new Insets(5, 5, 5, 5); panel.add(resultName, c); resultNameTextField = new JTextField(); c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); panel.add(resultNameTextField, c);
void init(){ textIn=new JTextArea(); textIn.setLineWrap(false); textIn.setWrapStyleWord(true); textOut=new JTextArea(); textOut.setLineWrap(false); textOut.setWrapStyleWord(true); textOut.setEditable(false); textOut.setText(""); jspOut=new JScrollPane(textOut); jspOut.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
buttonPanel.add(new JButton(okAction)); if (!solutionBusiness.isConstraintMatchEnabled()) { JPanel unsupportedPanel = new JPanel(new BorderLayout()); JLabel unsupportedLabel = new JLabel("Constraint matches are not supported with this ScoreDirector."); unsupportedPanel.add(unsupportedLabel, BorderLayout.CENTER); unsupportedPanel.add(buttonPanel, BorderLayout.SOUTH); setContentPane(unsupportedPanel); } else { detailLabel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); bottomPanel.add(detailLabel, BorderLayout.NORTH); final JTextArea detailTextArea = new JTextArea(10, 80); JScrollPane detailScrollPane = new JScrollPane(detailTextArea); bottomPanel.add(detailScrollPane, BorderLayout.CENTER); int selectedRow = table.getSelectedRow(); if (selectedRow < 0) { detailTextArea.setText(""); } else { ConstraintMatchTotal constraintMatchTotal = constraintMatchTotalList.get(selectedRow); detailTextArea.setText(buildConstraintMatchSetText(constraintMatchTotal)); detailTextArea.setCaretPosition(0);
lSizeValue = new javax.swing.JLabel(); spDescription = new javax.swing.JScrollPane(); taDescription = new javax.swing.JTextArea(); lStatus = new javax.swing.JLabel(); lStatusValue = new javax.swing.JLabel(); taDescription.setLineWrap(true); taDescription.setRows(2); taDescription.setText(desc.getDescription()); spDescription.setViewportView(taDescription);
l = new JLabel("icon"); // <-- this will be an icon instead of a iconPanel.add(l, BorderLayout.NORTH); p.add(iconPanel, BorderLayout.WEST); ta = new JTextArea(); ta.setLineWrap(true); ta.setWrapStyleWord(true); p.add(ta, BorderLayout.CENTER); final boolean hasFocus) { ta.setText((String) value); int width = list.getWidth();
lSizeValue = new javax.swing.JLabel(); spDescription = new javax.swing.JScrollPane(); taDescription = new javax.swing.JTextArea(); lStatus = new javax.swing.JLabel(); lStatusValue = new javax.swing.JLabel(); taDescription.setLineWrap(true); taDescription.setRows(2); taDescription.setText(desc.getDescription()); spDescription.setViewportView(taDescription);
innerPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); JLabel messageLabel = new JLabel("<html><b>Error: </b>" + exception.getMessage() + " " + extraMessage + "</html>"); JTextArea textArea = new JTextArea(); textArea.setFont(Theme.EDITOR_FONT); StringWriter sw = new StringWriter(); exception.printStackTrace(pw); log = sw.toString(); textArea.setText(log); textArea.setEditable(false); textArea.setCaretPosition(0); JScrollPane scrollPane = new JScrollPane(textArea); innerPanel.add(messageLabel, BorderLayout.NORTH); innerPanel.add(scrollPane, BorderLayout.CENTER); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING, 10, 10)); if (showQuitButton) { buttonPanel.add(quitButton);