Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display the browser output  RSS feed

 
Albretch Mueller
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
USing the JEditorPane you can code a lousy, very basic Browser in minutes, but how could you simply let the Browser render itself the output in a pane split inside of a frame?
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean with "the browser render itself the output inside a pane split inside of a frame"?
which browser? JEditorPane is the only browser java comes with by default. and it is, well, lousy, your're right. there are very good java browsers available for commercial licence, for example NetClue.
if you mean to use the rendering engine of mozilla to render html pages inside a java window - that would be a fine thing. I'd be interested in hints how to do this!
cheers
Chantal
 
Albretch Mueller
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rewording it for your/our understanding, I mean
"using the rendering engine of mozilla to render html pages inside a java window"
I don't think this should be a big deal and it definitely is the simplest way to render html in any window, since you have a full blown rendering engine/browser, mozilla, anyway.
 
Albretch Mueller
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually let me be a little more clear. You can open native applications in Java, e.g.:
import java.lang.*;
import java.io.*;
public class TestRuntimeExec00{
public static void main(String[] args){
Runtime RT = Runtime.getRuntime();
/*
// __ For Web Access
String[] azExecArgs = {
"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE",
"http://www.google.com/"
};
*/
// __ For Local Access
String[] azExecArgs = {
"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE",
"C:\\apps\\j2sdk1.4.0\\docs\\api\\index.html"
};
try{
Process Prx = RT.exec(azExecArgs);
Prx.waitFor();
System.out.println("Process exit code is: " + Prx.exitValue());
}catch(IOException IOX){ IOX.printStackTrace(); }
catch(InterruptedException IntX){ IntX.printStackTrace(); }
}
}
The thing is making ie to open the browser inside a java Swing or AWT Window
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if you can run native code inside a java frame. I suppose, it is quite a lot of work to implement some communication mechanism between java and the native code. and it wouldn't be platform independent anymore. it wouldn't be less work than implementing a good pure java rendering engine.
Chantal
 
Albretch Mueller
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chantal/group,
a conceptual hack stroke me as a really simple way to achieve what we were trying to do.
What about frames?
You could have the browser take care of business in one frame and have another frame with the java applet/application's window ...
It is amazing we hadn't thought about that option
:roll:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!