Results 1 to 2 of 2
  1. #1
    usccar is offline Member
    Join Date
    Dec 2009
    Posts
    2
    Rep Power
    0

    Question How to display image in JEditorPane

    I need to display formatted html in JEditorPane.
    Java Code:
     String txt1 = "<html><body><img src=\"C:/image/google.png\">Inside html </body></html>";
            Pane.setText(txt1);
    The image appears as broken. Is there any way to display it from disk?

  2. #2
    usccar is offline Member
    Join Date
    Dec 2009
    Posts
    2
    Rep Power
    0

    Default

    Java Code:
      
    FileInputStream fr=new FileInputStream("C:/images/crossword.txt");
                         InputStreamReader isr=new InputStreamReader(fr,"UTF-8");
                Pane.read(isr, null);
    I tried the above as well, but the links and scripts don't work and the images still appear broken.

Similar Threads

  1. Display image on jsp page
    By shuchi.vishnoi in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 11-30-2010, 12:46 PM
  2. can display image in JFrame?
    By xCLARAx in forum AWT / Swing
    Replies: 14
    Last Post: 04-03-2009, 07:02 PM
  3. How to display an image in a Form
    By LankanSniper in forum AWT / Swing
    Replies: 3
    Last Post: 03-25-2009, 10:48 AM
  4. How to display image ?
    By Birkoff in forum AWT / Swing
    Replies: 7
    Last Post: 06-09-2008, 07:58 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
  •