final JEditorPane editor = new JEditorPane(); editor.setEditorKit(JEditorPane.createEditorKitForContentType("text/html")); editor.setEditable(false);
public static void setHTMLEditorKit (JEditorPane editorPane) { editorPane.getDocument().putProperty("imageCache", imageCache); // Read internally by ImageView, but never written. editorPane.setEditorKit(new HTMLEditorKit() { private static final long serialVersionUID = -54602188235105448L;
//Create a new JEditorPane JEditorPane yourPane = new JEditorPane(); //Set the custom HTMLEditorKit yourPane.setEditorKit(new LargeHTMLEditorKit()); //Set the zoom to 150% yourPane.getDocument().putProperty("ZOOM_FACTOR", new Double(1.5));
private Component buildView() { JavaKit kit = new JavaKit(); JEditorPane editor = new JEditorPane(); editor.setEditorKit(kit); // JEditorPane editor = TSEditorUtils.createEditor( kit ); // JComponent comp = TSEditorUtils.getExtComponent( editor ); m_editor = editor; return new JScrollPane(editor); }
protected void init() { String REGISTER_KEY_URL = "https://labs.libre-entreprise.org/account/editsshkeys.php"; String DOC_URL = "http://isis-fish.labs.libre-entreprise.org/isis-fish/v3/user/addSshKey.html"; StringBuilder builder = new StringBuilder(); builder.append("<a href='").append(DOC_URL).append("'>"); builder.append(t("isisfish.vcs.howto.save.key")).append("</a><br/>"); builder.append("<a href='").append(REGISTER_KEY_URL).append("'>"); builder.append(t("isisfish.vcs.save.key")).append("</a>"); helpEditor.setEditorKit(new HTMLEditorKit()); helpEditor.setText(builder.toString()); }
/** * Creates a new CoBrowser object to be used with the specifid ChatRoom. */ public HTMLViewer() { final JPanel mainPanel = new JPanel(); browser = new JEditorPane(); browser.setEditorKit(new HTMLEditorKit()); setLayout(new GridBagLayout()); this.add(mainPanel, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); }
public VersionUpdateDialog(String versionString) { initComponents(); messagePane.setEditorKit(JEditorPane.createEditorKitForContentType("text/html")); messagePane.setEditable(false); messagePane.setText("<strong>A later version of IGV is available (" + versionString + ").<p/>Download from " + "<a href=" + Globals.downloadURL + ">" + Globals.downloadURL + "</a></strong>"); }
public void createCreditsPanel() { JEditorPane editor = (JEditorPane) m_view.getComponentByName(AboutViewNames.ID_CREDITS); editor.setEditorKit(new javax.swing.text.html.HTMLEditorKit()); try { java.net.URL url = AboutView.class.getClassLoader().getResource("com/jeta/swingbuilder/resources/help/credits.htm"); editor.setPage(url); editor.setEditable(false); } catch (Exception e) { e.printStackTrace(); } }
@Override public JComponent getPreviewComponent() { if (previewPane == null) { previewPane = new JEditorPane(); previewPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(FmtOptions.class, "AN_Preview")); //NOI18N previewPane.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(FmtOptions.class, "AD_Preview")); //NOI18N previewPane.setEditorKit(CloneableEditorSupport.getEditorKit(FileUtils.PHP_MIME_TYPE)); previewPane.setEditable(false); } return previewPane; }
@Override public JComponent getPreviewComponent() { if (previewPane == null) { previewPane = new JEditorPane(); previewPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(FmtOptions.class, "AN_Preview")); //NOI18N previewPane.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(FmtOptions.class, "AD_Preview")); //NOI18N previewPane.putClientProperty("HighlightsLayerIncludes", "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.SyntaxHighlighting$"); //NOI18N previewPane.setEditorKit(CloneableEditorSupport.getEditorKit(MIMENames.FORTRAN_MIME_TYPE)); previewPane.setEditable(false); } return previewPane; }
public JComponent getPreviewComponent() { if (previewPane == null) { previewPane = new JEditorPane(); previewPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(FmtOptions.class, "AN_Preview")); //NOI18N previewPane.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(FmtOptions.class, "AD_Preview")); //NOI18N previewPane.putClientProperty("HighlightsLayerIncludes", "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.SyntaxHighlighting$"); //NOI18N previewPane.setEditorKit(CloneableEditorSupport.getEditorKit(RubyInstallation.RUBY_MIME_TYPE)); previewPane.setEditable(false); } return previewPane; }
public TestHTML(String[] args) throws Exception { super(args); setName("HTML"); text = "<Vector<sup><b>Graphics</b></sup> & Adapter<i><sub>Card</sub></i> " + "= e<sup>x<sup>2</sup>y<sup>3</sup></sup>>"; JEditorPane pane = new JEditorPane(); pane.setContentType("text/html"); pane.setEditorKit(new HTMLEditorKit()); pane.setText(text); pane.setEditable(false); add(pane); }
JEditorPane jEditorPane = new JEditorPane(); HTMLEditorKit kit = new HTMLEditorKit(); StyleSheet styleSheet = kit.getStyleSheet(); styleSheet.addRule("A {color:red}"); //change links to red jEditorPane.setEditorKit(kit);
@Override public JComponent getPreviewComponent() { if (previewPane == null) { previewPane = new JEditorPane(); previewPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(EditorOptionsPanelController.class, "AN_Preview")); //NOI18N previewPane.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(EditorOptionsPanelController.class, "AD_Preview")); //NOI18N previewPane.putClientProperty("HighlightsLayerIncludes", "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.SyntaxHighlighting$"); //NOI18N previewPane.setEditorKit(CloneableEditorSupport.getEditorKit(language.toMime())); previewPane.setEditable(false); } return previewPane; }
private void initSourceEditor() { sourceEditorPane.setEditorKit(MimeLookup.getLookup(HTML_CONTENT_TYPE).lookup(EditorKit.class)); // ui Font font = new JLabel().getFont(); sourceEditorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true); sourceEditorPane.setFont(font); previewTextPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true); previewTextPane.setFont(font); }
private void createUIComponents() { final Font font = UIManager.getFont("Label.font"); final String bodyRule = "body { font-family: " + font.getFamily() + "; " + "font-size: " + font.getSize() + "pt; }"; discountEditorPane = new JEditorPane(); discountEditorPane.setEditorKit(new HTMLEditorKit()); ((HTMLDocument) discountEditorPane.getDocument()).getStyleSheet().addRule(bodyRule); discountEditorPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE); } }
public static void createEditorKit(ActionContext actionContext){ Thing self = (Thing) actionContext.get("self"); JEditorPane parent = (JEditorPane) actionContext.get("JEditorPane"); for(Thing child : self.getChilds()){ EditorKit c = (EditorKit) child.doAction("create", actionContext); if(c != null){ parent.setEditorKit(c); break; } } }
public void run() { // #23486: pane could not be initialized yet. if(pane != null) { Document doc = support.createStyledDocument( pane.getEditorKit()); pane.setDocument (doc); pane.setEditorKit (null); } removeAll(); initialized = false; } }
public void run() { // #23486: pane could not be initialized yet. if(pane != null) { Document doc = support.createStyledDocument( pane.getEditorKit()); pane.setDocument (doc); pane.setEditorKit (null); } removeAll(); initialized = false; } }
private void setStyleSheets() { StyleSheet styleSheet = new StyleSheet(); styleSheet.addRule("body {font-size: " + Driver.getFontSize() + "pt}"); styleSheet.addRule("H1 {color: red; font-size: 120%; font-weight: bold;}"); styleSheet.addRule("code {font-family: courier; font-size: " + Driver.getFontSize() + "pt}"); styleSheet.addRule(" a:link { color: #0000FF; } "); styleSheet.addRule(" a:visited { color: #800080; } "); styleSheet.addRule(" a:active { color: #FF0000; text-decoration: underline; } "); HTMLEditorKit htmlEditorKit = new HTMLEditorKit(); htmlEditorKit.setStyleSheet(styleSheet); mainFrame.summaryHtmlArea.setEditorKit(htmlEditorKit); }