use of javax.swing.JEditorPane in project knime-core by knime.
the class AggregationMethods method createDescriptionPane.
/**
* Creates a {@link JScrollPane} that lists all available aggregation
* methods and a short description of each method.
*
* @return a {@link JScrollPane} that can be added to any dialog to display
* all available aggregation methods and their description.
*/
public static JScrollPane createDescriptionPane() {
final StringBuilder buf = getHTMLDescription();
final JEditorPane editorPane = new JEditorPane("text/html", buf.toString());
editorPane.setEditable(false);
final JScrollPane scrollPane = new JScrollPane(editorPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
return scrollPane;
}
use of javax.swing.JEditorPane in project vcell by virtualcell.
the class BioPaxObjectPropertiesPanel method main.
public static void main(String[] argv) {
JEditorPane jep = new JEditorPane("text/html", "The rain in <a href='http://foo.com/'>" + "Spain</a> falls mainly on the <a href='http://bar.com/'>plain</a>.");
jep.setEditable(false);
jep.setOpaque(false);
jep.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent hle) {
if (HyperlinkEvent.EventType.ACTIVATED.equals(hle.getEventType())) {
System.out.println(hle.getURL());
}
}
});
JEditorPane jep1 = new JEditorPane("text/html", "ala bala por to calaala bala por to calaala bala por to calaala bala por to calaala bala por to cala");
jep1.setEditable(false);
jep1.setOpaque(false);
JPanel p = new JPanel();
p.add(new JLabel("Foo."));
p.add(jep);
p.add(new JLabel("Bar."));
p.add(new JEditorPane("text", "ala bala por to calaala bala por to calaala bala por to calaala bala por to calaala bala por to cala"));
p.add(jep1);
JFrame f = new JFrame("HyperlinkListener");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(p, BorderLayout.CENTER);
f.setSize(400, 150);
f.setVisible(true);
}
use of javax.swing.JEditorPane in project vcell by virtualcell.
the class SpeciesPropertiesPanel method getPCLinkValueEditorPane.
private JEditorPane getPCLinkValueEditorPane() {
if (PCLinkValueEditorPane == null) {
PCLinkValueEditorPane = new JEditorPane();
PCLinkValueEditorPane.setContentType("text/html");
PCLinkValueEditorPane.setEditable(false);
PCLinkValueEditorPane.setBackground(UIManager.getColor("TextField.inactiveBackground"));
PCLinkValueEditorPane.setText(null);
}
return PCLinkValueEditorPane;
}
use of javax.swing.JEditorPane in project processdash by dtuma.
the class BlameHistoryDialog method showCalculationError.
public void showCalculationError(Throwable calcError) {
calcError.printStackTrace();
ProjectHistoryException phe;
if (calcError instanceof ProjectHistoryException) {
phe = (ProjectHistoryException) calcError;
} else if (projectHistory != null) {
phe = projectHistory.wrapException(calcError);
} else {
phe = new ProjectHistoryException(calcError, "Dir.Cannot_Read_HTML_FMT", dataLocation);
}
String title = resources.getString("Message.Error");
String message = "<html><div style='width:400px'>" + phe.getHtml() + "</div></html>";
JEditorPane pane = new JEditorPane("text/html", message);
pane.setEditable(false);
pane.setBackground(null);
JOptionPane.showMessageDialog(this, pane, title, JOptionPane.ERROR_MESSAGE);
showReadyMessage();
}
use of javax.swing.JEditorPane in project jgnash by ccavanaugh.
the class AboutDialog method addHTMLTab.
private JComponent addHTMLTab(final String name, final String url) {
try {
URL noticeURL = HTMLResource.getURL(url);
JEditorPane p = new JEditorPane(noticeURL);
Font font = UIManager.getFont("Label.font");
String bodyRule = "body { font-family: " + font.getFamily() + "; " + "font-size: " + font.getSize() + "pt; }";
((HTMLDocument) p.getDocument()).getStyleSheet().addRule(bodyRule);
p.setEditable(false);
p.setAutoscrolls(true);
JScrollPane pane = new JScrollPane(p);
tabbedPane.add(name, pane);
return pane;
} catch (final Exception e) {
Logger.getLogger(AboutDialog.class.getName()).log(Level.SEVERE, e.toString(), e);
}
return null;
}
Aggregations