> > but strange is that when I use the code below
> > for creating a popup-frame - the frameset is shown and works
[quoted text clipped - 3 lines]
> of the document that you load it with. For HTML documents, that is an
> HTMLEditorKit.
but it seems to be that the HTMLFrameHyperlinkEvent is recognizing
the frameset and interprete it in a correct way, if there's nothing
else then Lowlevel HTML - which is all I need, just pictures and
some text and I Like to have framesets... the faq of this group
gave more common hints... so the solution is still a research value..
> I just tried displaying some FrameSets and it appears to work somewhat, so
> I guess I was wrong on that. However, it did blow up a lot with CSS
> errors when I tried to load the main J2SE JavaDocs. It has been a while
> since I tried using a JEditorPane for serious HTML, so I probably cannot
> help much here.
try the HTML code below and you'll see a correct displayed frameset
with href...target= which works,
so I search for a way to get the "function" of the
HTMLFrameHyperlinkEvent
into my panel...
because if I use HyperlinkEvent in my panel and add it to the
tabbedPanel
it displays only the last given html-file of the frameset without any
pictures or other formats also no cr/lf (<br>)is made... only the
background color remind me that this could be HTML...
if I set the navigation html as the last frame all will be shown in a
tiny panel but the targeted-link won't work...
could it be possible, that the way I implement the HyperlinkListener
is only usable for rtf ?
the panel which display not the defiened HTML (..??..) is here
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.html.*;
import javax.accessibility.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.net.*;
public class HTMLpanel extends JPanel{
JEditorPane htmlp;
public static void main(String[] args) {
HTMLpanel demo = new HTMLpanel(args[0]);
JFrame frame = new JFrame();
frame.getContentPane().setLayout(new BorderLayout());
frame.setSize(640,480);
frame.getContentPane().add(demo, BorderLayout.CENTER);
frame.setVisible(true);
}
public HTMLpanel(String path) {
try {
URL url = null;
try {
url = getClass().getResource(path);
} catch (Exception e) {
System.err.println("wrong path!! " + path);
url = null;
}
if(url != null) {
htmlp = new JEditorPane(url);
htmlp.setEditable(false);
htmlp.doLayout();
html.addHyperlinkListener(new HyperlinkListener () {
public void hyperlinkUpdate(final HyperlinkEvent e) {
if (e.getEventType() ==
HyperlinkEvent.EventType.ACTIVATED) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
htmlp.setPage(e.getURL());
} catch (IOException io) {
System.out.println("NO HOPE");
}
}
});
}
}
});
JScrollPane scroller = new JScrollPane();
scroller.getViewport().add(html);
add(scroller, BorderLayout.CENTER);
}
} catch (MalformedURLException e) {
System.out.println("Malformed URL: " + e);
} catch (IOException e) {
System.out.println("IOException: " + e);
}
}
}
> I will say that I have found that JEditorKit is not exactly a robust HTML
> viewer. If you want to use it to display your own HTML, then you can make
> sure to only use things that work well. However, I long ago concluded
> that using it for arbitrary HTML on the web is a non-starter.
Yep, thats what I plan to do, just very simple html-files no plugins
and so far just simple formated text with pictures. I'll write my own
HTML writer to support this.
just for your interest that HTMLFrame is also able to show
a HTML ImageMap but this will ignore the <a href=".." target=..
it'll not working using frame-technic.
if you got any further hints I am greedy to get them
best regrads
rolf
now following the sample-frameset:
The HTML code which is correct diplayed in the HTMLFrame and incorrect
displayed in the panel is:
index.html
<html>
<head><title>test</title></head>
<frameset cols="205,*" frameborder="no">
<frame src="navigation.html" name="navi">
<frame src="start.html" name="main">
</frameset>
<noframes>Your browser is not able to show the
frameset</noframes></html>
</html>
navigation.html
<html>
<head>
</head>
<body bgColor="#FCBF49">
<a HREF="00.html" target="main" >Start</a><br>
<a HREF="01.html" target="main" ><IMG SRC="01.gif"
BORDER="0"></a><br>
<a HREF="02.html" target="main" ><IMG SRC="02.gif"
BORDER="0"></a><br>
<a HREF="03.html" target="main" ><IMG SRC="03.gif"
BORDER="0"></a><br>
<a HREF="04.html" target="main" ><IMG SRC="04.gif"
BORDER="0"></a><br>
<a HREF="05.html" target="main" ><IMG SRC="05.gif"
BORDER="0"></a><br>
<a HREF="06.html" target="main" ><IMG SRC="06.gif"
BORDER="0"></a><br>
<a HREF="start.html" target="main" >Start</a><br>
</body>
</html>
start.html
<html>
<head>
<title>start</title>
</head>
<body bgcolor="#FAF6ED">
<table border=0>
<tr>
<td>
<font face="Helvetica" >
<b><big> Start</big></b><br>
</font>
<font face="Helvetica" size=3>
any text
<p><b><i>source</i></b></p>
</font>
</td>
<td><img src="00.gif" >
</td>
</tr>
</body>
</html>
John McGrath - 19 Feb 2005 18:58 GMT
> if you got any further hints I am greedy to get them
Sorry - I have nothing.

Signature
Regards,
John McGrath