Search in sources :

Example 16 with JTextPane

use of javax.swing.JTextPane in project languagetool by languagetool-org.

the class AboutDialog method show.

public void show() {
    String aboutText = Tools.getLabel(messages.getString("guiMenuAbout"));
    JTextPane aboutPane = new JTextPane();
    aboutPane.setBackground(new Color(0, 0, 0, 0));
    aboutPane.setBorder(BorderFactory.createEmptyBorder());
    aboutPane.setContentType("text/html");
    aboutPane.setEditable(false);
    aboutPane.setOpaque(false);
    aboutPane.setText(String.format("<html>" + "<p>LanguageTool %s (%s)<br>" + "Copyright (C) 2005-2016 the LanguageTool community and Daniel Naber<br>" + "This software is licensed under the GNU Lesser General Public License.<br>" + "<a href=\"http://www.languagetool.org\">http://www.languagetool.org</a><br>" + "Java max/total/free memory: %sMB, %sMB, %sMB</p>" + "<p>Maintainers or former maintainers of the language modules -<br>" + "(*) means language is unmaintained in LanguageTool:</p><br>" + "</html>", JLanguageTool.VERSION, JLanguageTool.BUILD_DATE, Runtime.getRuntime().maxMemory() / 1024 / 1024, Runtime.getRuntime().totalMemory() / 1024 / 1024, Runtime.getRuntime().freeMemory() / 1024 / 1024));
    Tools.addHyperlinkListener(aboutPane);
    JTextPane maintainersPane = new JTextPane();
    maintainersPane.setBackground(new Color(0, 0, 0, 0));
    maintainersPane.setBorder(BorderFactory.createEmptyBorder());
    maintainersPane.setContentType("text/html");
    maintainersPane.setEditable(false);
    maintainersPane.setOpaque(false);
    maintainersPane.setText(getMaintainers());
    int prefWidth = Math.max(520, maintainersPane.getPreferredSize().width);
    int maxHeight = Toolkit.getDefaultToolkit().getScreenSize().height / 2;
    maxHeight = Math.min(maintainersPane.getPreferredSize().height, maxHeight);
    maintainersPane.setPreferredSize(new Dimension(prefWidth, maxHeight));
    JScrollPane scrollPane = new JScrollPane(maintainersPane);
    scrollPane.setBorder(BorderFactory.createEmptyBorder());
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
    panel.add(aboutPane);
    panel.add(scrollPane);
    JOptionPane.showMessageDialog(parent, panel, aboutText, JOptionPane.INFORMATION_MESSAGE);
}
Also used : JScrollPane(javax.swing.JScrollPane) JTextPane(javax.swing.JTextPane) JPanel(javax.swing.JPanel) Color(java.awt.Color) BoxLayout(javax.swing.BoxLayout) Dimension(java.awt.Dimension)

Example 17 with JTextPane

use of javax.swing.JTextPane in project zaproxy by zaproxy.

the class LicenseFrame method getTxtLicense.

/**
	 * This method initializes txtLicense
	 *
	 * @return javax.swing.JTextPane
	 */
private JTextPane getTxtLicense() {
    if (txtLicense == null) {
        txtLicense = new JTextPane();
        txtLicense.setName("txtLicense");
        txtLicense.setEditable(false);
    }
    return txtLicense;
}
Also used : JTextPane(javax.swing.JTextPane)

Example 18 with JTextPane

use of javax.swing.JTextPane in project zaproxy by zaproxy.

the class LicenseFrame method getTxtLicense.

/**
	 * This method initializes txtLicense
	 *
	 * @return javax.swing.JTextPane
	 */
private JTextPane getTxtLicense() {
    if (txtLicense == null) {
        txtLicense = new JTextPane();
        txtLicense.setName("txtLicense");
        txtLicense.setEditable(false);
    }
    return txtLicense;
}
Also used : JTextPane(javax.swing.JTextPane)

Example 19 with JTextPane

use of javax.swing.JTextPane in project ACS by ACS-Community.

the class ErrorTreeCellRenderer method getTextMessagePane.

/**
	 * This method initializes jTextPane	
	 * 	
	 * @return javax.swing.JTextPane	
	 */
private static JTextPane getTextMessagePane() {
    if (textMessagePane == null) {
        textMessagePane = new JTextPane();
        textMessagePane.setEditable(false);
    }
    return textMessagePane;
}
Also used : JTextPane(javax.swing.JTextPane)

Example 20 with JTextPane

use of javax.swing.JTextPane in project nhin-d by DirectProject.

the class ComponentCreation method createComponent.

/**
	 * Process the container pane to create different swing component as per the identifier given as parameter
	 * @param type This decide which component should be created
	 * @param labelData This is the value of a component/or can be used as title of the component
	 * @param flag This is used to make any check box or radio button selected
	 * @param c is a object of GridBagConstarins, and used to set any grid layout
	 * @param pane Container object to add component into this pane
	 * @param myButtonGroup used for radio or check boxes to group together
	 * @param gridx This is the x index integer value for the component inside the grid
	 * @param gridy This is the y index integer value for the component inside the grid
	 * @return void 
	 */
public void createComponent(String type, String lableData, boolean flag, GridBagConstraints c, Container pane, ButtonGroup myButtonGroup, int gridx, int gridy) {
    if (type.equalsIgnoreCase("RADIO")) {
        JRadioButton aButton = new JRadioButton(lableData, flag);
        c.gridx = gridx;
        c.gridy = gridy;
        pane.add(aButton, c);
        /*
			 * Button group to make the dynamic movement of screens
			 */
        TrustBundlePublisher ex = new TrustBundlePublisher();
        if (myButtonGroup != null) {
            myButtonGroup.add(aButton);
            if (lableData.equalsIgnoreCase("  Create Unsigned Trust Bundle")) {
                //UnSignedTrustBundle ex = new UnSignedTrustBundle();
                aButton.addActionListener(ex);
            } else if (lableData.equalsIgnoreCase("  Create Signed Trust Bundle")) {
                //SignedTrustBundle ex = new SignedTrustBundle();
                aButton.addActionListener(ex);
            } else {
                //ViewTrustBundle ex = new ViewTrustBundle();
                aButton.addActionListener(ex);
            }
        }
    } else if (type.equalsIgnoreCase("LABEL")) {
        JLabel label1 = new JLabel(lableData);
        c.gridx = gridx;
        c.gridy = gridy;
        pane.add(label1, c);
    } else if (type.equalsIgnoreCase("TEXT")) {
        JTextField field = new JTextField();
        c.gridx = gridx;
        c.gridy = gridy;
        pane.add(field, c);
    } else if (type.equalsIgnoreCase("PASSWORD")) {
        //JTextField field = new JTextField();
        JPasswordField passwordField = new JPasswordField(10);
        //passwordField.setActionCommand(OK);
        //passwordField.addActionListener(this);
        c.gridx = gridx;
        c.gridy = gridy;
        pane.add(passwordField, c);
    } else if (type.equalsIgnoreCase("BUTTON")) {
        JButton button = new JButton(lableData);
        c.gridx = gridx;
        c.gridy = gridy;
        pane.add(button, c);
        ButtonSelector create = new ButtonSelector(pane);
        button.addActionListener(create);
    } else if (type.equalsIgnoreCase("TEXTPANE")) {
        JTextPane jTextPane = new JTextPane();
        jTextPane.setEditable(false);
        jTextPane.setBackground(new Color(238, 238, 238));
        ;
        //jTextPane.setSize(55, 10);
        c.gridx = gridx;
        c.gridy = gridy;
        pane.add(jTextPane, c);
    } else if (type.equalsIgnoreCase("TEXTAREA")) {
        JTextArea jTextPane = new JTextArea(lableData);
        jTextPane.setEditable(false);
        jTextPane.setBackground(new Color(238, 238, 238));
        ;
        c.gridx = gridx;
        c.gridy = gridy;
        pane.add(jTextPane, c);
    }
}
Also used : JTextPane(javax.swing.JTextPane) JRadioButton(javax.swing.JRadioButton) JTextArea(javax.swing.JTextArea) JPasswordField(javax.swing.JPasswordField) Color(java.awt.Color) TrustBundlePublisher(org.nhindirect.trustbundle.ui.TrustBundlePublisher) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Aggregations

JTextPane (javax.swing.JTextPane)32 JScrollPane (javax.swing.JScrollPane)13 JButton (javax.swing.JButton)9 JLabel (javax.swing.JLabel)9 JPanel (javax.swing.JPanel)8 Color (java.awt.Color)6 Dimension (java.awt.Dimension)6 JRadioButton (javax.swing.JRadioButton)6 JTextField (javax.swing.JTextField)6 Insets (java.awt.Insets)4 IOException (java.io.IOException)4 JCheckBox (javax.swing.JCheckBox)4 JPasswordField (javax.swing.JPasswordField)4 JTable (javax.swing.JTable)4 BorderLayout (java.awt.BorderLayout)3 Component (java.awt.Component)3 FlowLayout (java.awt.FlowLayout)3 Font (java.awt.Font)3 GridBagConstraints (java.awt.GridBagConstraints)3 GridBagLayout (java.awt.GridBagLayout)3