import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
public class Fenster extends JApplet implements HyperlinkListener {
static JEditorPane edit = new JEditorPane();
LeftPane left = new LeftPane();
RightPane right = new RightPane();
JPanel mainPane = new JPanel();
JScrollPane scroll = new JScrollPane(edit);
public void init() {
edit.setEditable(false);
edit.addHyperlinkListener(this);
left.setPreferredSize(new Dimension(25, 610));
right.setPreferredSize(new Dimension(25, 610));
mainPane.setLayout(new BorderLayout());
mainPane.add(left, BorderLayout.WEST);
mainPane.add(right, BorderLayout.EAST);
mainPane.add(scroll);
try {
edit.setPage(new URL(getCodeBase(), "go_Home.html"));
edit.getPage();
}
catch (IOException e) {
System.out.println(e);
}
setContentPane(mainPane);
}
public void hyperlinkUpdate(HyperlinkEvent hyl) {
if (hyl.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
try {
if (hyl.getDescription().startsWith("http://")) {
getAppletContext().showDocument(new URL(hyl.getDescription()), "_blank");
}
else {
edit.setPage(new URL(getCodeBase(), hyl.getDescription()));
edit.getPage();
}
}
catch(IOException e) {
System.out.println(e);
}
}
}
}
class LeftPane extends JPanel {
public void paintComponent(Graphics comp) {
Graphics2D comp2D = (Graphics2D)comp;
comp2D.setColor(new Color(120, 0, 0));
comp2D.fillRect(0, 0, 25, 610);
comp2D.setColor(Color.black);
comp2D.fillRoundRect(0, 0, 50, 610, 610, 610);
}
}
class RightPane extends JPanel {
public void paintComponent(Graphics comp) {
Graphics2D comp2D = (Graphics2D)comp;
comp2D.setColor(new Color(120, 0, 0));
comp2D.fillRect(0, 0, 25, 610);
comp2D.setColor(Color.black);
comp2D.fillRoundRect(-25, 0, 50, 610, 610, 610);
}
}