Results 1 to 11 of 11

Thread: display images

  1. #1
    prof.deedee is offline Member
    Join Date
    Oct 2009
    Posts
    36
    Rep Power
    0

    Default display images

    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 ...

  2. #2
    prof.deedee is offline Member
    Join Date
    Oct 2009
    Posts
    36
    Rep Power
    0

    Default

    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..??

  3. #3
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    5

  4. #4
    prof.deedee is offline Member
    Join Date
    Oct 2009
    Posts
    36
    Rep Power
    0

    Default

    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..??

  5. #5
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    5

    Default

    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.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

  7. #7
    prof.deedee is offline Member
    Join Date
    Oct 2009
    Posts
    36
    Rep Power
    0

    Default

    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

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    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.

  9. #9
    prof.deedee is offline Member
    Join Date
    Oct 2009
    Posts
    36
    Rep Power
    0

    Default

    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

  10. #10
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    5

    Default

    One of the prior responses deserves more attention:
    Better yet, take a look and JEditorPane.read().
    Insert the JEditorPane into the JFrame.

  11. #11
    prof.deedee is offline Member
    Join Date
    Oct 2009
    Posts
    36
    Rep Power
    0

Similar Threads

  1. Dynamic display of images
    By gixerino in forum NetBeans
    Replies: 7
    Last Post: 01-15-2009, 02:55 PM
  2. Replies: 8
    Last Post: 12-29-2008, 07:12 AM
  3. Replies: 0
    Last Post: 06-28-2008, 09:26 PM
  4. images
    By amith in forum AWT / Swing
    Replies: 3
    Last Post: 06-27-2008, 08:38 PM
  5. Replies: 0
    Last Post: 03-25-2008, 12:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •