Is it possible to make an web Java applet that loads a web page? I need to load an web page inside a web page.
An iframe, object and other HTML things I don't need. I need just a Java applet.
Some source code or tutorials?
It is possible.
Swing text components support HTML (EditorPanes at Java Tutorials) but if the web page is too complex it might not be displayed correctly.
Related
I need to render HTML page from a Java String. The String contains a full HTML page which may include CSS and Javascript. I know that some CSS/script reference may missing because I only has the html, so it's not a problem.
I have tried using JEditorPane, but it only works for very simple HTML. If it can't render, it will display nothing.
Is there any library I can use?
You can use the Desktop class. It will open the default browser of your platform.
Read the section from the Swing tutorial on How to Integrate With the Desktop Class for more information and working examples.
I am trying to make a web browser that works entirely on voice commands (i.e speech-to-text and vice versa using sphinx.)
I have a Java applet, but I don't know how to add a parser to it so that different parts of different websites go to a particular segment in my browser.
What are the necessary steps to add a parser to a web browser applet?
You don't need java applet, it creates too many issues. You need something like pocketsphinx.js:
https://github.com/syl22-00/pocketsphinx.js
This technology can give you access to content of the browser with javascript, a way easier way to manage things.
Now i am able to make a fully speech based web browser. I used Jsoup for extracting various elements of any web page. Then with the help of sphinx and freetts i allowed users to interact with browser by using speech commands only.
I have been writing c#, html, js, jquery for awhile and been using F12 in chrome and IE to look at the html code to help me with some dom manipulation. I am curious if there is a way to do something similar to that context to look at a jsp page and manipulate it with javascript.
For example: viewsource on a jsp page and fill out a textbox on the jsp page with javascript.
I hope the question is clear and the example makes sense. I am not working on anything with this so I don't have a real example. This is more of curiosity. I know javascript but I am not familiar with java at all.
The jsp file gets compiled to a servlet on the Application Server which is then executed. This servlet then produces html on the server side, therefore you can not view the jsp source code client side (F12 in chrome). You can only view the generated output (html, css, js, ...).
Source: http://oreilly.com/catalog/jserverpages2/chapter/ch03.html
JSP is compiled and run on the server side--the same place you edit it (more or less).
Only HTML is sent to the client.
In addition,
You write in C#, so if you generate simple ASP.NET page and see how a dynamic page is being generated.
It's not JSP/Java but It have the same concept of dynamic pages.
As school project I need to develop a java Mid let that will ask for a URI. Then the
application will make an HTTP connection using the given URI and retrieve a HTML
page, and display it to the user.
I am able to give the HTML link but it displays the HTML code when I run the application.
i am using java net beans
Thanks, any help is really appreciated
What you actually need is to open native browser and show HTML page in it. This can be done using platform call:
getInstance().platformRequest("http://bombusqd.hdd1.ru/m/")
getInstance() is a method of MidLet.
We have a Java desktop app with an embedded browser, now using XULRunner (Firefox engine) on SWT. This browser's API allows us to load webs specifying an URI or its HTML content.
What we need is to load HTML webpages including resources but being everything in memory. The best solution would be to provide a listener used when the engine tries to load resources so we can send it the appropriate content.
Any ideas? thank you!
It sounds like you need a small HTTP / web server. There is Jetty, there are also a few smaller ones, just search for "small java web server" or so.
In HTML 5 your can put your resources inside the HTML itself.
So you can use SWT with browser that supports HTML 5 and prepare your webpages to have resources inside HTML 5.
With SWT Browser your can simply do browser.setText(html) to load the page from memory.