How to display an image on the HTML page by using applet

Dear friends,
I am now writing an java applet, I want to display an image on the HTML page, and tried the following commands:
{color:#ff00ff}{color:#000000}Image map; //put in the class definition
map=getImage(getCodeBase(),"hhh.gif"); //put in the function of init()
g.drawImage(map,0,300,this); //put in the function of paint(){color}
{color}
However, when I run it, the image wasn't displayed at all.
I hope who guys ever come across this problem could help me to solve it. Thank you in advance!
Hawaii

Hi,
I am no expert on Images
but
from personal exp.
are you sure that map actually contains the image?
try using
ImageIcon ii = ImageIcon(String name);
map = ii.getImage();I saw a tutorial on images i think on sun
where they use ImageIcon to load the image

Similar Messages

  • How to display horizontal line in top-of-page by using object oriented ALV?

    How to display horizontal line in top-of-page by using object oriented ALV.
    I am created top-of-page in object oriented alv.
    But not be successes in showing horizontal line in it.
    Can any one pls give solution for this..
    Thanks and regards..

    Hi
    Try like this
    data: gt_list_top_of_page type slis_t_listheader. " Top of page text. 
    Initialization. 
    perform comment_build using gt_list_top_of_page[]. 
    form top_of_page. 
    * Note to self: the gif must be loaded into transaction OAOR with 
    * classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions. 
    * I Loaded NOVALOGO2 into system. 
    call function 'REUSE_ALV_COMMENTARY_WRITE' 
         exporting 
    * I_LOGO = 'NOVALOGO2' 
    * i_logo = 'ENJOYSAP_LOGO' 
             it_list_commentary = gt_list_top_of_page. 
    endform. " TOP_OF_PAGE 
    form comment_build using e04_lt_top_of_page type slis_t_listheader. 
    data: ls_line type slis_listheader. 
          clear ls_line. 
          ls_line-typ = 'A'. 
          ls_line-info = 'Special'(001). 
          fgrant = xgrant. 
          concatenate ls_line-info fgrant 
          'Stock Option Report to the board'(002) 
                 into ls_line-info separated by space. 
                        condense ls_line-info. 
          append ls_line to e04_lt_top_of_page. 
    endform. " COMMENT_BUILD
    Use following syntex for footer print in alv:
    * For End of Page
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *  For End of Report
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    check this link
    http://abapprogramming.blogspot.com/
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d
    Changing width of a custom container dynamically
    Display Page numbers in ALV
    Insert picture in selection screen.
    Logo in OO ALV Grid
    Reward all helpfull answers
    Regards
    Pavan

  • How to populate a table in the html page from the java script

    Hi all,
    I have doubt in populating a table in the html page. my application is as follows
    I have a html page in which i have a combo box and a table following the combo box.
    i have to populate the table depending on the item selected in the combo box.
    for this i am using javascript to get the value of combo box onClick
    then i have to call some function thru jsp to get the data and then i have to populate the table with thst into from java script
    how can i do this, i.e populating html table from java script
    Thanks in advance
    satya

    Hi Mihai,
    You can populate data in DO_INIT_CONTEXT method of ur impl class in your Z component.
    data:
    lv_struct_ref type ref to YOUR_STRUCTURE,
    lv_value_node type ref to cl_bsp_wd_value_node,
    lv_bo_coll type ref to if_bol_bo_col.
    Data: current type ref to if_bol_bo_property_access.
    data: dref type ref to data.
    data: lv_guid_h type crmt_object_guid.
    data: lt_attr type table of YOUR_STRUCTURE.
    data: ls_attr type YOUR_STRUCTURE.
    data: lr_entity type ref to cl_crm_bol_entity.
    create object lv_bo_coll type cl_crm_bol_bo_col.
    lt_attr is ur internal table.
    Loop at lt_attr into ls_attr.
      create data lv_struct_ref.
      create object lv_value_node
           exporting
                iv_data_ref = lv_struct_ref.
    call method lv_value_node->if_bol_bo_property_access~set_property
    exporting
    iv_attr_name = 'YOURFIELDNAME1'
    iv_value = ls_attr-firstname.
    call method lv_value_node->if_bol_bo_property_access~set_property
    exporting
    iv_attr_name = ' YOURFIELDNAME2'
    iv_value = ls_attr-lastname.
    lv_bo_coll->add( lv_value_node ).
    typed_context->YOURCONTEXTNODE->set_collection( lv_bo_coll ).
    endloop.
    Regards,
    Raghu

  • How to display BLOB images from the Oracle database within Crystal

    Let's say a have the following table
    IMAGES
    ========
    DOC_ID NUMBER
    DOC_NAME STRING
    DOC_IMAGE BLOB
    The BLOB field can have any type of document: PDF, email, WORD, EXcel, etc. I would like to present the DOC_ID and DOC_NAME and let the user click any of them. Once the user clicks the document stored in the database as BLOB, it is rendered using the default application associated to the extension. For example if the file name is ABC.XLS open MSExcel if the file is abc.pdf open Acrobat.
    I am using Crystal2008 and evaluating Crystal 4.0
    Does this requires programming?
    Thanks!!!

    Hi
    Crystal is a reporting tool and you canu2019t execute any code except free hand SQL.  When you pull any BLOB fields in crystal, it takes as a picture field and if that field contains image only it will display in your report.
    If you have any information other than image, it will not display any info in the report.
    If you want to insert Word , PDF and Excel then you will have to insert as ole object and can manage with location of the files.
    Thanks,
    Sastry

  • How to display japanese charecters in the JSP page

    Hi,
    Below is my jsp page where i am trying to read the japan character from the properties file
    through the Resource bundle.
    ===============================================
    <%@page contentType="text/html" %>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import ="java.util.*" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    <%Locale locale = new Locale(request.getParameter("country"));
    ResourceBundle bundle = ResourceBundle.getBundle("com.sunit.regtool.resources.RegTool",locale);
    String namelabel =bundle.getString("userName");
    String passwordlabel= bundle.getString("password");
    %>
    <%=namelabel %>
    </body>
    </html>
    =========================================================
    In the above code i am getting the value of the country from request object i.e its value
    will be en for English ,ja for japanese etc.
    I am able to get the value from Resource bundle but when my country is japan
    i am not able to see the same japan characters in the browser when i get the JSP on the browser at runtime .
    It shows me " �����&#133;� &#136;�&#131;&#149;�&#130;��&#131;��&#131;��&#131;&#137;" where the charecters are different.
    But when i see in the properties file it is fine.
    Please help me what need to be done furher for this.
    Thanks,
    Kiran

    I think you need to install japanese language fonts in your browser.

  • How to display large text document (2-3 pages) without using the webpage widget?

    Hello all,
    We are designing this online course and our project leader asked us to try to include the course materials/contents within the Captivate file as much contents as we can. However, we have several "big" text-based files to display, such as syllabus, standards, project templates, etc.
    I know that the webpage widget created by Jim Leichliter can "embed" web pages and PDF files into Captivate. However, as mentioned before, our project leader wants everything to reside within Captivate. That means that I can't use the web page widget to "quoate" an external PDF file.
    I also tried the extended Text Entry Area widget, but couldn't get it work. I would really appreciate it if someone could help me with this.
    Thank you very much.

    Would it be possible to create a table that had one row for every week? If so you could do something like this:
    DESC ALL_WEEKS
    NAME Null? Type
    WEEKENDING DATE
    SELECT A.CUST,
    B.WEEKENDING,
    SUBSTR(MAX(TO_CHAR(A.WEEKENDING,'YYYYMMDD')||A.STATUS),9,1)
    FROM YOUR_TABLE A,
    ALL_WEEKS B
    WHERE B.WEEKENDING <= A.WEEKENDING
    GROUP BY A.CUST,
    B.WEEKENDING;

  • How can I extract images form other web pages with an applet?

    Hello
    I have a problem
    Here is my code
    import java.net.*;
    import javax.swing.*;
    import java.awt.image.*;
    public class Cursbnr extends JApplet{
    public JLabel EuroValue =new JLabel();
         public JLabel DolarValue =new JLabel();
         public JLabel GoldValue =new JLabel();
         JPanel EuroBar = new JPanel();
         JPanel DolarBar = new JPanel();
         JPanel GoldBar = new JPanel();
         Image EuroImg=null;
         Image DolarImg=null;
         Image GoldImg=null;
         try{          
              EuroImg = this.getImage(new URL("http://www.bnro.ro/Images/Flags/eur.gif"));
              DolarImg = this.getImage(new URL("http://www.bnro.ro/Images/Flags/usd.gif"));
              GoldImg = this.getImage(new URL("http://www.bnro.ro/Images/Flags/xau.gif"));
    catch (MalformedURLException e) {
         System.err.println(e);
    When I run this applet whith eclipse it's working, but when I put the class file into a html and I ran the html it's not working
    What can I do?

    Duplicate of this post, reply there: http://forum.java.sun.com/thread.jspa?threadID=670274&messageID=3918814#3918814

  • How to display selected records on one HTML page?

    Hi,
    I would like to display selected part of records on one page in HTML region. For example I have a Master - Detail table set named Procedures and Tasks (each Procedure can have one or more tasks)
    I would like to be able to display all Tasks for a given Procedure in one HTML region on a page... The problem is that the number of tasks vary between procedures and can change in time. Also, the 'task description' can be very large so a simple report list of all tasks is something I cannot use... (I would like eg for the task name to be here, and the task_description to be there - unlike the report where everything is in one line...) The following are my ideas but non of them seemed to be feasable here...
    1. Use a report based on vertical columns (However I am using Theme 10 for which there are no vertical column templates. The only vertical templates I can see are the default ones but I have no idea how to customize them - where are they?)
    2. In HTML region use &ITEM_NAME. substitutions. In order to display more than one &EMN_NAME. (based on eg. EMPID) I suspect that I would need to write some kind of javascript loop. Has anyone have an idea about how would such a script look like?
    3. Display each Task in a separate screen. This is something I would want least but better than nothing - to have a customized report which would display one task at a time with some kind of pagination to it...
    Please let me know if someone has tried something simmilar or maybe there is a 4th option which will be simpler and easier...
    Many thanks,
    Pawel.
    I tried to make a very simple illustration of what I would like to achive here:
    http://htmldb.oracle.com/pls/otn/f?p=44995:3:9461299983704828937::::
    Message was edited by:
    padmocho

    Just to answer this one myself....
    In order to achive the above I used a PL/SQL Dynamic Content page and entered a html content in htp.prn('');
    Then, I created a PL/SQL LOOP which searches through the various rows...
    In the end, whenever I wanted to display html content I just used htp.prn and for variables I used htp.p(<var_name>);
    Maybe, it helps ;)

  • How do You set -noverify in an HTML page that calls an applet

    I have an applet which runs fine from inside JBuilder when I specify a
    -noverify switch in the debugger. (java -noverify myapplet.class)
    Without this switch, I get a verification exception.
    So I need to specify the -noverify switch from inside a webpage so that when the client runs it, he does not get the same exception.
    The question is how do you pass -noverify to JVM from an HTML page that uses <applet> tag and javascript?
    Thanks

    Odd, because I work on an applet that gets built with 1.4. We have 30,000+ clients who use it every day, and I'm sure we don't tell them about setting -noverify switches in their plug-in control panel, and we don't (cuz we can't) set it in the applet (object/embed, actually) tag.
    Of course, I suppose it could be a backwards compatibility issue going from compiling in newer version than it's run in.

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • How to display the HTML pages in RRC/RQM dashboard using OpenSocial gadget

    Hi,
    I have a requirement as below:
    1. I have couple of HTML pages which are hosted in the sharepoint site and I would like to display the HTML pages
    2. I would like to have an OpenSocial gadget in the RRC/RQM dashboard that will display the HTML pages  which are hosted in my sharepoint site.
    Could you please suggest the best approach to create an OpenSocial gadget in the IBM's RRC/RQM dashboard whcih will display html contents of another URL ?
    Thanks.
    Knowledge is power.

    Hi Manoj,
    As I understand, you would like to display SharePoint page in another platform.
    Since the you are involving third party platform, you might still need to contact their support engineer about how to render other pages.
    From SharePoint side, by default, SharePoint won't let end user to display site page to other platform, you could add "<WebPartPages:AllowFraming runat="server"/>" in master page or single page layout. So that SharePoint ASP.Net
    page could be displayed on other platform.
    Here I'm talking about ASP.Net page, since HTML page in SharePoint cannot be displayed in browser as I tested, it will be downloaded directly. So I'd suggest you use ASP.Net page as workaround.
    https://social.msdn.microsoft.com/Forums/office/en-US/c8755a6b-f33a-43ed-97d9-8f03c336aa1d/how-to-display-sharepoint-url-in-iframe-in-aspnet-page?forum=sharepointdevelopment
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Using WEB Output HTML Gallery and uploading using ftp upload the HTML page views correctly but images only display the alt tag?

    Using WEB Output HTML Gallery and uploading using ftp upload the HTML page views correctly but images only display the alt tag in the browser window?

    After a little investigation, I discovered that PNGs also do not render correctly in IE7 in similar circumstances.
    I ended up using Levels in Photoshop to bring the output blacks up to "5", saved the images as PNGs, modified the HTML from .jpg to .png, and that seems to have covered up the problem well enough.
    By the way, I did confirm that IE8 beta 2 renders the images correctly.
    Brian

  • How to get the HTML page size displayed in JEditorPane

    Hi All,
    I'm using a JEditorPane object in order to view/display an HTML page. The nature fo my program is that it does not know the size of the page in advance, but only on runtime. I'd like to get the size of the HTML page in order to determine the frame size according to the size of the HTML page.
    Is there a way to get the size of the HTML page from the JEditorPane?
    Thanks.

    after displaying the page in your editor pane you can get the diamension for the page by calling
    JComponent class method getSize();
    actually your question is not so clear
    use the JScroll pane then you don't need to worry about the size of the page.

  • How to Display an Image on my FORM

    Good Day!
    I would like to ask some help from you guys with my problem on how to display an image on my form. I would like to display my uploaded image on my form but instead of an image, the get_blob_file is showing. By the way, I'm using Apex 4.1
    I downloaded the Order Entry Sample Application and followed the Page 6, the Product Details. I even made snapshots of each details from Page Rendering to Page Processing in order not to miss a thing.
    At the moment, I was able to upload or store the image on my created Oracle table and also able to retrieve it on the Download Link Text with Content Disposition value of Inline, provided by APEX Settings. If I invoke the Download link beside the file browser, a page with the image will be shown, below is the address:
    http://127.0.0.1:8080/apex/apex_util.get_blob_file?a=200&s=339877802936975&p=230&d=7107921433296839&i=7107601420296838&p_pk1=54&p_pk2=&p_ck=7D6512D967336C4B94258EEA3CDF1BE6&p_content_disposition=inline
    However, instead of showing the image on a region, below is the one showing on my Form:
    <img src="apex_util.get_blob_file?a=200&s=339877802936975&p=230&d=7107921433296839&i=7107601420296838&p_pk1=54&p_pk2=&p_ck=7D6512D967336C4B94258EEA3CDF1BE6" />
    As you can see the parameter values are the same but I know I missed something that's why I'm here :)
    I would highly appreciate all the help you can provide and many thanks in advance.
    I tried to change gear by making an html region of type PL/SQL (anonymous block) and a procedure but still no image :(
    Below are the scripts.
    declare
    cursor cur is
    select *
    from wsemployee
    where empid = :P230_EMPID;
    begin
    for rec in cur
    loop
    IF rec.mime_type is not null or rec.mime_type != '' THEN
    htp.p( '<img src="my_image_display?p_image_id='||NVL(rec.empid,0)||'" height="'||100||'"/>' );
    else
    htp.p( 'No Image ');
    END IF;
    htp.p( ' ');
    end loop;
    end;
    PROCEDURE
    create or replace PROCEDURE my_image_display( p_image_id IN NUMBER)
    AS
    l_mime VARCHAR2 (255);
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, PHOTO_BLOB_CONTENT, PHOTO_FILENAME,DBMS_LOB.GETLENGTH(photo_blob_content)
    INTO l_mime,lob_loc,l_file_name,l_length
    FROM wsemployee
    WHERE empid = p_image_id;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(l_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || l_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||replace(replace(substr(l_file_name,instr(l_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    END my_image_display;
    Edited by: user13831927 on Dec 22, 2012 3:24 PM

    Hi Ying,
    you can add a UDF to the table spp2 with a programm
    but the table is not yet listed in the 'Manage User Fields' form.
    there's no way to "enable" it - sorry

  • How to paste an image from the database by creating a new page?

    Hai,
    i'm trying to paste more than 6 images in two pages...
    The condition is that i want to paste only 3 images in a page.
    When the first 3 images were pasted... i want a new page to be automatically created and the next or 4th image will be pasted on the
    next page...
    i have codings for creating a new page and for pasting the image...
    But how shall shall i paste the 4th image in the next page...
    Can any one plzz explain me...

    >
    Hi, I'd like to display a dynamic image from the web inside a JLabel or any other swing component it could work in. I've been looking on the Swing tutorials and others forums, all I can have is that a JLabel can load an Icon object, defined by an image URL, but can this URL be like "http://xxxxx/image.jpg" somehow or can it only be a local image URL?>
    I do not know why you start talking about an image on the web then go on to show concerns about whether it will work for a 'local' URL.
    But perhaps this answer will cover the possibilities.
    So long as you can from an URL to the image, and the bytes are available for download (e.g. some web sites wrap a direct call to an image in HTML that embeds the image), the URL based icon constructors will successfully load it.
    It does not matter if that URL points to
    - a web site,
    - a local server ('localhost'),
    - an URL representation of a File on the local file system, or
    - it is inside a Jar file that is on the application's run-time classpath.
    How you go about forming a valid URL to a 'local resources' (or indeed what you regard as local resources) is another matter, depending on the form of the project, and how the resources are stored (see list above).
    Probably the main reason that examples use images at a hard coded URL on the net is that it makes an 'image example' self contained. As soon as we compile and run it, we can see the result. I have posted a few examples like that on these forums.
    Edit 1:
    BTW - Welcome to the Sun forums
    Edited by: AndrewThompson64 on Apr 21, 2009 12:15 PM

Maybe you are looking for