This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-12-05 19:59:38

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Java: HTML Code => Swing Frame?

Is there any way to input HTML code and output a swing component with the HTML code parsed? (Preferably with webkit.)


http://i.imgur.com/BAEgGDL.png

Offline

 

#2 2012-12-06 00:15:30

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Java: HTML Code => Swing Frame?

There is no way to do this without external libraries. Even then it may be quite a project to get working.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#3 2012-12-06 07:39:44

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Java: HTML Code => Swing Frame?

MathWizz wrote:

There is no way to do this without external libraries. Even then it may be quite a project to get working.

yeah, you'd essentially have to make a web browser in java, which is no easy feat


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#4 2012-12-06 10:01:44

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Java: HTML Code => Swing Frame?

SJRCS_011 wrote:

MathWizz wrote:

There is no way to do this without external libraries. Even then it may be quite a project to get working.

yeah, you'd essentially have to make a web browser in java, which is no easy feat

Can you recommend me one?


http://i.imgur.com/BAEgGDL.png

Offline

 

#5 2012-12-06 17:42:11

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Java: HTML Code => Swing Frame?

GeonoTRON2000 wrote:

SJRCS_011 wrote:

MathWizz wrote:

There is no way to do this without external libraries. Even then it may be quite a project to get working.

yeah, you'd essentially have to make a web browser in java, which is no easy feat

Can you recommend me one?

well, i guess you could try lobo, but i dont know how good it is

oh, and webkit is written in C++, so i dont think it would work well with java

Last edited by SJRCS_011 (2012-12-06 17:42:41)


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#6 2012-12-06 23:00:39

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Java: HTML Code => Swing Frame?

SJRCS_011 wrote:

GeonoTRON2000 wrote:

SJRCS_011 wrote:


yeah, you'd essentially have to make a web browser in java, which is no easy feat

Can you recommend me one?

well, i guess you could try lobo, but i dont know how good it is

oh, and webkit is written in C++, so i dont think it would work well with java

I go this error:

Code:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface sun.font.FontManager, but class was expected
    at org.lobobrowser.util.gui.FontFactory.createFont(FontFactory.java:210)
    at org.lobobrowser.util.gui.FontFactory.createFont_Impl(FontFactory.java:180)
    at org.lobobrowser.util.gui.FontFactory.createFont(FontFactory.java:127)
    at org.lobobrowser.util.gui.FontFactory.getFont(FontFactory.java:98)
    at org.lobobrowser.html.style.StyleSheetRenderState.<clinit>(StyleSheetRenderState.java:43)
    at org.lobobrowser.html.domimpl.NodeImpl.<clinit>(NodeImpl.java:39)
    at org.lobobrowser.html.parser.DocumentBuilderImpl.createDocument(DocumentBuilderImpl.java:143)
    at org.lobobrowser.html.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:97)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)

when I tried to do this:

Code:

display.setDocument(dbi.parse((InputStream) new ByteArrayInputStream(WebIO.stripHeaders(WebIO.go(WebIO.METHOD_GET, togo.toExternalForm(), "", "", "")).getBytes()), togo.toExternalForm()), rcontext);

http://i.imgur.com/BAEgGDL.png

Offline

 

Board footer