public void run() { if (mainForm == null) { mainForm = new SwingForm(name); } String html = core.getFormHtml(); core.setFormHtml(null); // For some reason, the <meta http-equiv="Content-Type" // content="text/html"> tag generated by SAXON screws up the // JEditorPane, so replace it with a dummy tag. int i = html.indexOf("<meta"); if (i > 0) { html = html.substring(0, i + 1) + "blah" + html.substring(i + 5); } mainForm.jedit.setText(html); mainForm.setSize(width, height); mainForm.validate(); mainForm.setVisible(true); } }
private SwingForm(String name) { setTitle(name); // setBackground(Color.gray); getContentPane().setLayout(new BorderLayout()); JPanel topPanel = new JPanel(); topPanel.setLayout(new BorderLayout()); getContentPane().add(topPanel, BorderLayout.CENTER); jedit = new JEditorPane(); jedit.setEditorKit(new CustomHTMLEditorKit()); jedit.setEditable(false); jedit.addHyperlinkListener(this); JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().add(jedit, BorderLayout.CENTER); topPanel.add(scrollPane, BorderLayout.CENTER); }
} else { if (popupForm == null) { popupForm = new SwingForm(popupName); popupForm.setSize(700, 500); popupForm.setLocation(this.getX() + 30, this.getY() + 30); popupForm.setVisible(true);
height = Integer.parseInt(attr.getValue()); SwingForm.create(name, width, height, this);
} else { if (popupForm == null) { popupForm = new SwingForm(popupName); popupForm.setSize(700, 500); popupForm.setLocation(this.getX() + 30, this.getY() + 30); popupForm.setVisible(true);
SwingForm.destroy();
height = Integer.parseInt(attr.getValue()); SwingForm.create(name, width, height, this);
public void run() { if (mainForm == null) { mainForm = new SwingForm(name); } String html = core.getFormHtml(); core.setFormHtml(null); // For some reason, the <meta http-equiv="Content-Type" // content="text/html"> tag generated by SAXON screws up the // JEditorPane, so replace it with a dummy tag. int i = html.indexOf("<meta"); if (i > 0) { html = html.substring(0, i + 1) + "blah" + html.substring(i + 5); } mainForm.jedit.setText(html); mainForm.setSize(width, height); mainForm.validate(); mainForm.setVisible(true); } }
private SwingForm(String name) { setTitle(name); // setBackground(Color.gray); getContentPane().setLayout(new BorderLayout()); JPanel topPanel = new JPanel(); topPanel.setLayout(new BorderLayout()); getContentPane().add(topPanel, BorderLayout.CENTER); jedit = new JEditorPane(); jedit.setEditorKit(new CustomHTMLEditorKit()); jedit.setEditable(false); jedit.addHyperlinkListener(this); JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().add(jedit, BorderLayout.CENTER); topPanel.add(scrollPane, BorderLayout.CENTER); }