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);
}
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;
}
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;
}
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;
}
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);
}
}
Aggregations