Refine search
/** * Creates a new <code>DetailPanel</code> instance. * * @param aTable the table to listen for selections on * @param aModel the model backing the table */ DetailPanel(JTable aTable, final MyTableModel aModel) { mModel = aModel; setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder("Details: ")); mDetails = new JEditorPane(); mDetails.setEditable(false); mDetails.setContentType("text/html"); add(new JScrollPane(mDetails), BorderLayout.CENTER); final ListSelectionModel rowSM = aTable.getSelectionModel(); rowSM.addListSelectionListener(this); }
private void displayTsurgeonHelp() { if(tsurgeonHelpFrame != null) { tsurgeonHelpFrame.setVisible(true); } else { tsurgeonHelpFrame = new JFrame("TSurgeon Help..."); JEditorPane helpText = new JEditorPane(); helpText.setContentType("text/html"); // StringBuffer s = new StringBuffer(); // s.append(htmlTsurgeonHelp); helpText.setText(htmlTsurgeonHelp); helpText.setEditable(false); JScrollPane scroller = new JScrollPane(helpText); helpText.setCaretPosition(0); scroller.setPreferredSize(new Dimension(500,500)); tsurgeonHelpFrame.add(scroller); tsurgeonHelpFrame.pack(); tsurgeonHelpFrame.setBackground(Color.WHITE); tsurgeonHelpFrame.setVisible(true); } }
private void displayHelp() { if (helpFrame != null) { helpFrame.setVisible(true); } else { helpFrame = new JFrame("Tregex Help..."); //JPanel helpPanel = new JPanel(); JEditorPane helpText = new JEditorPane(); helpText.setContentType("text/html"); // StringBuffer s = new StringBuffer(); // s.append(htmlHelp); helpText.setText(htmlHelp); helpText.setEditable(false); //helpPanel.add(helpText); JScrollPane scroller = new JScrollPane(helpText); helpText.setCaretPosition(0); scroller.setPreferredSize(new Dimension(500,500)); helpFrame.add(scroller); helpFrame.pack(); helpFrame.setBackground(Color.WHITE); helpFrame.setVisible(true); //helpFrame.repaint(); } }
private void buildContentPanel() { editorPane = new JEditorPane (); editorPane.setContentType("text/rtf"); editorPane.addKeyListener(new InputListener()); // defaultAttrSet = ((StyledEditorKit)editorPane.getEditorKit()).getInputAttributes(); StyleConstants.setFontFamily(defaultAttrSet, "Lucinda Sans"); Document doc = new DefaultStyledDocument(); editorPane.setDocument(doc); try { doc.insertString(0, initText, defaultAttrSet); } catch (Exception ex) { throw new RuntimeException(ex); } JScrollPane scrollPane = new JScrollPane(editorPane); frame.getContentPane().add(scrollPane, BorderLayout.CENTER); editorPane.setEditable(true); }
private void buildContentPanel() { editorPane = new JEditorPane (); editorPane.setContentType("text/rtf"); editorPane.addKeyListener(new InputListener()); // defaultAttrSet = ((StyledEditorKit)editorPane.getEditorKit()).getInputAttributes(); StyleConstants.setFontFamily(defaultAttrSet, "Lucida Sans"); Document doc = new DefaultStyledDocument(); editorPane.setDocument(doc); try { doc.insertString(0, initText, defaultAttrSet); } catch (Exception ex) { throw new RuntimeException(ex); } JScrollPane scrollPane = new JScrollPane(editorPane); frame.getContentPane().add(scrollPane, BorderLayout.CENTER); editorPane.setEditable(true); }
setSize(800, 600); chatLog = new JEditorPane(); chatLog.setEditable(false); chatLog.setContentType("text/html"); chatLog.setText("<html><body>");
JEditorPane op = new JEditorPane(); op.setContentType("text/html"); op.setEditable(false);
/** * Creates a non-editable widget to display the error message. * */ final JComponent createErrorMessage(Throwable t) { String txt = t.getLocalizedMessage(); JEditorPane msg = new JEditorPane(); msg.setContentType("text/plain"); msg.setEditable(false); msg.setText(txt); return msg; }
/** * Creates a new <code>DetailPanel</code> instance. * * @param aTable the table to listen for selections on * @param aModel the model backing the table */ DetailPanel(JTable aTable, final MyTableModel aModel) { mModel = aModel; setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder("Details: ")); mDetails = new JEditorPane(); mDetails.setEditable(false); mDetails.setContentType("text/html"); add(new JScrollPane(mDetails), BorderLayout.CENTER); final ListSelectionModel rowSM = aTable.getSelectionModel(); rowSM.addListSelectionListener(this); }
JEditorPane jep = new JEditorPane(); jep.setEditable(false); try { jep.setPage("http://www.yoursite.com"); }catch (IOException e) { jep.setContentType("text/html"); jep.setText("<html>Could not load</html>"); } JScrollPane scrollPane = new JScrollPane(jep); JFrame f = new JFrame("Test HTML"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(scrollPane); f.setPreferredSize(new Dimension(800,600)); f.setVisible(true);
private void addWelcomeCard(JPanel panel, String name) { try { JEditorPane editor = new JEditorPane(TikaGUI.class.getResource("welcome.html")); editor.setContentType("text/html"); editor.setEditable(false); editor.setBackground(Color.WHITE); editor.setTransferHandler(new ParsingTransferHandler( editor.getTransferHandler(), this)); panel.add(new JScrollPane(editor), name); } catch (IOException e) { e.printStackTrace(); } }
private void textDialog(String title, URL resource) { try { JDialog dialog = new JDialog(this, title); JEditorPane editor = new JEditorPane(resource); editor.setContentType("text/html"); editor.setEditable(false); editor.setBackground(Color.WHITE); editor.setPreferredSize(new Dimension(400, 250)); editor.addHyperlinkListener(this); dialog.add(editor); dialog.pack(); dialog.setVisible(true); } catch (IOException e) { e.printStackTrace(); } }
public void run() { JEditorPane jep = new JEditorPane(); jep.setContentType("text/html");//set content as html jep.setText("Welcome to <a href='http://stackoverflow.com/'>StackOverflow</a>.");
text[0] = new JEditorPane(); text[0].setContentType("text/html");
String url = "http://host/path"; JEditorPane htmlPane = new JEditorPane(url); htmlPane.setContentType("text/html");
public static JEditorPane newHtmlJEditorPane() { final JEditorPane descriptionPane = new JEditorPane(); descriptionPane.setEditable(false); descriptionPane.setContentType("text/html"); return descriptionPane; }
JEditorPane pane = new JEditorPane(); pane.setContentType("text/html"); String urlForImage = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"; pane.setText("<html><img src=\"" + urlForImage + "\" /></html>"); myJframe.add(pane);
JEditorPane editorPane = new JEditorPane(); editorPane.setContentType("text/html"); editorPane.setText("<b>This text is bold</b>");
JEditorPane ep = new JEditorPane(); ep.setContentType("text/html"); ep.setText("html code");
JEditorPane jep = new JEditorPane(); jep.setContentType("text/html"); jep.setText("<html> <b>Termination time : </b></html>" + CriterionFunction.estimateIndividual_top(individual) + "\n");