}
protected WindowSupport init() {
stack = new Stack();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
// Has to happen before first push
browserLaunch = new JButton("Open in Browser");
URL url = this.getClass().getResource("w.gif");
ImageIcon imageIcon = new ImageIcon(url, "Go back");
backButton = new JButton(imageIcon);
dismissButton = new JButton("Close");
//////
jep = new JEditorPane();
jep.setEditable(false);
jep.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
JEditorPane pane = (JEditorPane) e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
Debug.message("minibrowser",
"processing HTMLFrameHyperlinkEvent");
HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
HTMLDocument doc = (HTMLDocument) pane.getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
} else {
Debug.message("minibrowser",
"processing HyperlinkEvent");
try {
push(e.getURL());
} catch (Throwable t) {
t.printStackTrace();
}
}
}
}
});
JScrollPane jsp = new JScrollPane(jep, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.NORTHWEST;
c.insets = new Insets(5, 5, 5, 5);
c.weightx = 1;
c.weighty = 1;
gridbag.setConstraints(jsp, c);
add(jsp);
JPanel buttonPanel = new JPanel();
GridBagLayout gridbag2 = new GridBagLayout();
GridBagConstraints c2 = new GridBagConstraints();
buttonPanel.setLayout(gridbag2);
c2.fill = GridBagConstraints.NONE;
c2.anchor = GridBagConstraints.WEST;
c2.weightx = 0;