hi
1-in my simple web browser how can I display image without using setPage method ??
2-how can I control the frame name to display the current url name?? like any other browsers ...
Printable View
hi
1-in my simple web browser how can I display image without using setPage method ??
2-how can I control the frame name to display the current url name?? like any other browsers ...
note :
that images of course in the web pages and I can read web text but I don't know how to display that page images and as I said I don't want to use setPage..??
please help me because I don't use Java before and now I have to built a web browser !!!!!!
I try :
ImageIO.read(URL)
Graphics.drawImage(Image, ...)
but it doesn't work will
how can use it to read from the url it is images and then display these images as its in the original place and display it in JFrame f..??
The ImageIO.read(URL) is in the method that is reading the HTML data stream.
Better yet, take a look and JEditorPane.read().
Insert the JEditorPane into the JFrame.
If you decide not to use JEditorPane, the Graphics.drawImage(Image, ...) call would go in the paint() method of a JPanel.
Do not write directly on a JFrame; instead put a JPanel in the JFrame and draw on it.
Why are you trying to build a web browser when you've never used Java before? Is this for a job or class assignment? Either way it sounds like you're biting off way more than you could chew and would benefit by tackling a much simpler problem until you understand Java rudiments. Just my 2 kopeks.
I have to built web browser because its class assignment and because I never use Java before but I worked in C++ and the lecturer said it is the same with little differences and then I found it same but with BIG differences so now I have to move on ,work hard and try to finish this course with acceptable mark..!!!!!!
So can u help me or not???
because I wont to learn but I need some help
Is the web browser the first assignment you were given then?
There exists API specs for those methods and classes that you are trying to use. Open them up and read them to find out how the methods are used.
Yes it's and I try hard and find the way to display the URL text and how to activate the hyperlinks (without using setPage method) but I am stuck with images
One of the prior responses deserves more attention:
Quote:
Better yet, take a look and JEditorPane.read().
Insert the JEditorPane into the JFrame.
Thank u everyone
it works now I can't stop dancing