Canot display image in browser?? help!!

<applet code="yew.yew.dirapplet"
   archive="Signed.jar"
   width=400 height=400>
</applet>i cant display out the image using appletviewer
but when i sign in the browser it cant display out the image.
i try many way but still cant solve tis ploblem.
I din include the .gif into the jar file onli store in the same directory
hope some applet expert can help.
Thanks in advanced

Do you use getImage??
Then use it like this:
this.getImage(this.getCodeBase(),"myfile.jpg"); // same dir as the appletthis.getImage(this.getCodeBase(),"../images/myfile.jpg"); // other dir than the appletStill doesn't work, please give us a full trace and some code where the exception occures.
To turn the full trace on (windows) you can start the java console, to be found here:
C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
In the advanced tab you can fill in something for runtime parameters fill in this:
-Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
if you cannot start the java console check here:
C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
I think for linux this is somewhere in youruserdir/java (hidden directory)
add or change the following line:
javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
for 1.5:
deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
The trace is here:
C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
I think for linux this is somewhere in youruserdir/java (hidden directory)
Print out the full trace of the exception:
try{...}catch(Exception e){e.printStackTrace();}

Similar Messages

  • Display Image in Browser

    Dear all,
    I have use the JLabel to add the ImageIcon with the filename passed under JPanel. It work on appletviewer but not in Browser.
    The appletviewer can show both ImageIcon at the top and the Text at the bottom. But the browser (IE) can only show the Text only. It seems that ImageIcon cannot be added in JLabel.
    May I missing something on the code?
    Here is my code:
    public final static DataFlavor LABEL_FLAVOR =
    new DataFlavor(JLabel.class, "Label Instances");
    public final static DataFlavor LOCAL_LABEL_FLAVOR = new DataFlavor(
    DataFlavor.javaJVMLocalObjectMimeType +
    "; class=javax.swing.JLabel", "Local Label");
    protected JLabel getLabelFromFile(File f) {
    //ImageIcon icon = new ImageIcon(f.getAbsolutePath());
    ImageIcon icon = new ImageIcon(f.getName());
    JLabel label = new JLabel(icon);
    label.setText(f.getName());
    label.setHorizontalTextPosition(JLabel.CENTER);
    label.setVerticalTextPosition(JLabel.BOTTOM);
    label.addMouseListener(this);
    label.addMouseMotionListener(this);
    return label;
    Thanks a lot!
    Peter

    Hi,
    Theres nothing wrong in ur code.
    the only problem is in IE's version of java(WFC) the File class doesnot have a getAbsolutePath() mehtos instead it uses the getFullPath() method which isn't there in the actual java class.Thats the reason why ur code isn't working on IE.Infact IE(WFC) doesn't implement any of the following methods
    getPath()
    getCanonicalPath()
    getParent()
    getparentFile()
    createNewFile()
    etc
    Maybe u could pass the path of the Image file as a parameter to the applet and then try to display it on the JLabel.
    Hope that helps.
    Regards,
    Partha

  • IWeb Displays Images Different! HELP!!!

    I am a photographer, and I put my best photos on my iWeb site. My photos are all normal, but when I view them after uploading onto the internet (on several different computer screens) all my photos have been automatically enhanced (more contrast, boosted saturation). I just spent eight hours editing my site, and all my photos look overly saturated and darker than the originals! I have used the tools (inspector, image adjust, colors), yet still, it does the same thing every time! However, this does not happen when the photos are in the photo gallery (default photo) page. This is a VERY serious issue, and I would greatly appreciate any help I can get.
    Message was edited by: Adam!

    Adam:
    Is the checkbox "Optimize images on import" checked in iWeb's preferences? If so you might uncheck it, delete the photos and add again. Also I'd resize them to the size you want on the page before adding. Then when added go to the Inspector/Graphics pane and click on the Original Size button.
    OT

  • Tomcat Doesnt display images in browser

    HI frnds,
    i m hving some prblm wid tomcat server.whenever i display my menu using tomcat 4.1, it displays the text but doesnt display the images,
    i hv checkd all the paths are correct.How to solve this prblm
    Looking frwrd for an early reply

    How are you getting it to display the images?
    Do you get a red x to indicate broken image?
    Right click it, select properties and see what the requested URL is. Is it correct?
    Most probably you are using an absolute link, without taking the web application context name into account

  • Display image from database with jspSmart

    Hi
    I have successfully uploaded and saved images into oracle(8.1.5) table DATA_TYPE(dtid number, iconname varchar2(30), icon blob). When I try to display a specific icon in my browser, I get "javax.servlet.ServletException: General error" at:
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    My code looks like this:
    imgModifyDataType.jsp
    <%
    ResultSet myResultSet = null;
    Statement myStatement = null;
    Connection myConnection = null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    myConnection = DriverManager.getConnection("Jdbc:Odbc:Te","te","te");
    String iconName;
    String pDTID = request.getParameter("dtid");
    String mySQL = "Select iconname, icon from data_types where dtid=?";
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    pstmt.setString(1,pDTID);
    myResultSet = pstmt.executeQuery();
    iconName = myResultSet.getString("iconname");
    myUpload.initialize(pageContext);
    myUpload.downloadField(myResultSet,"icon","application/x-msdownload", iconName);
    %>
    I call this JSP from another JSP like this:
    <img src="imgModifyDataType.jsp?dtid=<%=pDTID%>">
    If we cannt display image with the help of another jsp like this then please guide me how to modify the imgModifyDataType.jsp to a servlet because I have never worked in servlets.
    Please help
    Sajid

    I think that it may help you get image from database. I used two jsp page. First one is getphoto.jsp that makes as table based in sql statment and invoke the getimage.jsp this last returns images based on
    the getphoto.jsp PhotoId.
    /** getphoto.jsp source code */
    <%@page import="java.sql.*,oracle.jdbc.*"%>
    <html>
    <head>
    <title>
    jsp1
    </title>
    </head>
    <body bgcolor="#ffffff">
    <table width="781" border="2">
    <tr<<td>
    <td width="83" bgcolor="#C0C0C0"><b>PhotoId</b><td width="450" bgcolor="#C0C0C0"><b>Description</b></td><td width="228" bgcolor="#C0C0C0"><b>Photo Image</b></td>
    <%
    Connection conn = null;
    Statement stmt = null;
    ResultSet rset = null;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:thin:@itas:1521:oraITAS","yourDbUserId","yourDbPassword");
    stmt = conn.createStatement();
    rset = stmt.executeQuery("select photo_id,photo_description from photo");
    while (rset.next()) {
         %>
         <tr><td width="83"><%=rset.getObject("photo_id")%></td><td width="450"><%=rset.getObject("photo_description")%></td><td width="228"><img src="getimage.jsp?PhotoId=<%=rset.getObject("photo_id")%>" width="238" height="228"></td></tr>
         <%
    conn.close();
    %>
    </table>
    </body>
    </html>
    /** getimage.jsp source code */
    <%@ page contentType="image/jpeg; chaoResult=iso-8859-1" language="java" import="java.sql.*,java.io.*,java.util.*" errorPage="" %>
    <%
    String strConnString = null;
    Connection oDbConn;
    Statement oStmt;
    ResultSet oResult;
    String strConnection = null;
    String strUserId = "c_erober";
    String strUserPwd = "sybdev99";
    String strDatabase = "oraITAS";
    String strPhotoId;
    strConnString = "jdbc:odbc:" + strDatabase;
    String strSql;
    try {
    strPhotoId = (String) request.getParameter("PhotoId");
    strSql = "select photo_image from photo" + ( (strPhotoId==null) ? " where photo_id = '001'": (" where photo_id = '" + strPhotoId + "'") );
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    oDbConn = DriverManager.getConnection(strConnString,strUserId,strUserPwd);
    response.setContentType("image/jpeg");
    oStmt = oDbConn.createStatement();
    oResult = oStmt.executeQuery(strSql);
    oResult.next();
    byte[] bytearray = new byte[4096];
    int size=0;
    InputStream sImage;
    sImage = oResult.getBinaryStream(1);
    response.reset();
    response.setContentType("image/jpeg");
    response.addHeader("Content-Disposition","filename=getimage.jpeg");
    while((size=sImage.read(bytearray))!= -1 ) {
    response.getOutputStream().write(bytearray,0,size);
    response.flushBuffer();
    sImage.close();
    oDbConn.close();
    } catch (SQLException ex) { ex.getMessage();
    %>

  • Won't display background image in browser.

    My background image displays in dreamweaver and in the live view but it doesn't display in the browser when I try to view in a browser or when I publish the website.  I have spend hours looking for a solution and I am not sure what the problem is. I have checked the code on the following websites and it comes out ok:
    http://jigsaw.w3.org/css-validator/validator
    http://validator.w3.org/check
    I have also tried my code with and without the overflow: hidden;  under #container where the image should be displayed.  (i was trying a new way to design -ie without basic grid and floating everything so the container can be removed if needed)
    here is my code. Please help!!! thank you in advance!!!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Jan Kardys' Literary Agency</title>
    <style type="text/css">
    #header {
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        float: left;
        width: 930px;
        color: #3F9;
    #Menu_bar {
        float: left;
        width: 190px;
    #Page_Content {
        float: right;
        width: 725px;
        height: 500px;
    #footer {
        float: left;
        width: 930px;
    #Main_content {
        float: left;
        width: 510px;
    #xtra_content {
        float: right;
        width: 190px;
    #container {
        width:  930px;
        margin: 0 auto;
        background-image: url(/Images/Parchment.gif);
        overflow: hidden;
    </style>
    <script src="file:///C|/Users/james/Documents/DREAMWEAVER SITES/SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="file:///C|/Users/james/Documents/DREAMWEAVER SITES/SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    body {
    </style>
    </head>
    <body>
    <div id= "container">
    <div id="header"><h1>Jan kardy's Literary Agency</h1></div>
    <div id="Menu_bar">
      <ul id="Vertical_menubar" class="MenuBarVertical">
        <li><a href="#">Home</a></li>
        <li><a href="#">About Jan Kardys</a></li>
        <li><a class="MenuBarItemSubmenu" href="#">Rescources</a>
          <ul>
            <li><a class="MenuBarItemSubmenu" href="#">Education Connection</a>
            </li>
            <li><a href="#">Submission Guidelines</a></li>
            <li><a href="#">First Steps to Publishing</a></li>
            <li><a href="http://advancenetworkingunicorn.blogspot.com/">Advanceced Networkinig Blog</a></li>
            <li><a href="#">Library &amp; Publishing Events</a></li>
    </ul>
        </li>
        <li><a href="#">Client Links</a></li>
        <li><a href="#">Art Gallery</a></li>
        <li><a href="#">Contact Jan Kardys</a></li>
      </ul>
    </div>
    <div id="Page_Content">
      <div id="Main_content">Content for  id "Main_content" Goes Here</div>
      <div id="xtra_content"><h3>News &amp; Events
        </h3>
        <p><a title="http://scotlandpubliclibrary.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://scotlandpubliclibrary.org/">Scotland Public Library</a>, Scotland, CT April 21, 2011 6-8pm<br />
      </p>
        <p><a title="http://www.plymouthct.us/library.htm" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://www.plymouthct.us/library.htm">Plymouth CT Library</a>, Plymouth, CT April 30, 2011 10am<br />
        </p>
        <p><a title="http://www.hplct.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://www.hplct.org/">Hartford Public Library</a>, Hartford, CT May 7, 2011 10am<br />
        </p>
        <p><a title="http://www.middleburghlibrary.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://www.middleburghlibrary.org/">Middleburgh Library</a>, Middleburgh, NY May 14, 2011 1pm<br />
        </p>
        <p><a title="http://dewlib.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://dewlib.org/">Dewitt Community Library</a>, Dewitt, NY June 21, 2011 7pm<br />
        </p>
        <p><a title="http://gilfordlibrary.org/gpl/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://gilfordlibrary.org/gpl/">Gilford Public Library</a>, Gilford, NH July 7, 2011 6:30-7:30pm<br />
        </p>
        <p><a title="http://www.athollibrary.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://www.athollibrary.org/">Athol Public Library</a> Athol, MA July 14, 2011 5:30pm<br />
        </p>
        <p><a title="http://www.goshenpublib.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://www.goshenpublib.org/">Goshen Public Library</a> Goshen, CT July 23, 2011 11am<br />
        </p>
        <p><a title="http://columbiactlibrary.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://columbiactlibrary.org/">Saxton B. Little Free Library</a>, Columbia, CT July 26, 2011 6:45pm<br />
        </p>
        <p><a title="http://hampden-library.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://hampden-library.org/">Hampden Public Library</a>, Hampden, MA Sept. 10, 2011 10:30am<br />
        </p>
        <p><a title="http://fortlee.bccls.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://fortlee.bccls.org/">Fort Lee Public Library</a>, Fort Lee, NJ Sept. 14, 2011 7:00pm<br />
        </p>
        <p><a title="http://prosserlibrary.info/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://prosserlibrary.info/">Prosser Public Library</a>, Bloomfield, CT October 3, 2011 6:00-8:00pm<br />
        </p>
        <p><a title="http://iwwg.org" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://iwwg.org">IWWG. org</a>, New York City, October 16, 2011 2:30-6pm<br />
        </p>
        <p><a title="http://www.hchlibrary.org/" onkeypress="window.open(this.href); return false;" onclick="window.open(this.href); return false;" href="http://www.hchlibrary.org/">Henry Carter Hull Library</a>, Clinton, CT October 24, 2011 6:30pm<br />
        </p>
        <p><a href="http://town.canton.ma.us/library" title="http://town.canton.ma.us/library">Canton Public Library</a>, Canton MA Janurary 7, 2012  2:00pm<br />
        </p>
        <p><a href="http://www.town.sturbridge.ma.us/Public_Documents/F0000F86A/library" title="http://www.town.sturbridge.ma.us/Public_Documents/F0000F86A/library">Joshua Hyde Library</a>, Sturbridge, MA March 24, 2012 10:30am<br />
        </p>
        <p>Otis Library Norwich, CT April 14, 2012 12:00am-2:00pm<br />
        </p>
      </div>
    </div>
    <div id="footer"> <h6>Webpage designed by James S. Molina</h6></div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("Vertical_menubar", {imgRight:"/SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </div></body>
    </html>

    In regard to the files you currently have on your server, the links to your Spry menu files are still pointing to your local computer.  This is caused when a site has not yet been defined in Site Manager, so DW is forced to link them locally.
    To fix your page, just go into code view and remove the part of the link path that I have underlined and made BOLD.
    <script src="file:///C|/Users/james/Documents/DREAMWEAVER SITES/SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="file:///C|/Users/james/Documents/DREAMWEAVER SITES/SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />

  • Plz help me with displaying image.....

    hai friends,
    i am doin a simple project for my school in jsp and servlets.... actually my problem is very simple i tink ...but am unable to track out....and am new to jsp...actually i want to insert an image near my text...but am unable to display image...i simple get an ' X ' mark and the alternate text instead of the image ...is it tat my browser is unable to display images?? can i change the settings of my browser?? plz tell me how to do it ?? i hav pasted my code also....
    <tr>
                   <td valign=top width=100>
                   <img src="/images/icon.bmp" align=left width=30 height=30 alt="image"><a href="/project/servlet/SubforumviewServlet?name=<%= forname %>"><%= forname %></a>
                   </td>
              </tr>
    that forname is the name of my link..
    i hav another doubt also...is CSS like a template?? do we need to write the code or we can just include it to our jsp?? cos i need to enhance my jsp page to look more professional lik websites... sorry if my question is really childish.....plz help me !!!! thanx in advance..

    Hi...
    I tried your code and its working fine..I think the problem is with the location of your image. In the src attribute, give the correct location of the image. If you are giving /images/im.bmp, the folder images should be in the same directory as your jsp. Hope it help.
    Regards,
    Cochu.

  • My 8530 does not display images in the browser

    My bb 8530 a few weeks ago suddenly stopped displaying images in the browser. Browser options are set to "display images". I've power cycled many times, even reset and wiped, but still no images in browser. How can I fix this? Thanks.

    hi i have noticed the same problem. also with Chrome and FP ver 11.5.31.2and Firefox and Safari with FP 11.5.502.110
    it seems that MovieClipLoader class not returning onLoadInit event. I use to add a fadein function on loadInit to fade in the loaded images. with the latest Flash PLayer versions this is not activated so you cannot see the loaded images.
    I have tested this on 3 different systems and the problem is the same. I have not updated my FP for IE. There, the older FP still works well.
    test systems
    Mac OS LionSafari and FP 11.5.502.110 --- DOES NOT WORK WELL
    Windows 7 64 bit
    chrome 23.0.1271.95 with FP 11.5.31.2  - DOES NOT WORK WELL
    Firefox 16.02 with FP 11.5.502.110  - DOES NOT WORK WELL
    IE 9 with FP version 11.4.402.287  - WORKS
    Windows XP SP3
    Firefox 16.02 with FP 11.5.502.110 - DOES NOT WORK WELL
    IE 8 wth FP 11.4.402.287  - WORKS
    chrome 23.0.1271.95 with FP 11.5.31.2  - DOES NOT WORK WELL

  • Converting GIF images to JPG - display problems in browser

    I am currently writing a program that uses the ImageIO package (javax.imageio.*) to take GIF and PNG images and convert them to JPG images. The program seems to convert them correctly, especially for the PNG images, but the converted GIF images don't open in a browser. They open just fine in Windows Picture and Fax viewer, but when I try to open them in IE or Firefox, it only diplays the little red 'x'.
    Is anyone familiar enough with Images and the ImageIO package in Java that they may have some insight on why these converted GIF files won't display in a browser.

    Bonjour,
    In my [website|http://iweb.debutersurmac.com>, all the images are JPG files,
    By default iWeb '09 converts images to JPG (yes, it's true)...
    ...unless you use masked images*
    !http://i32.servimg.com/u/f32/09/02/44/99/masked10.jpg!
    Crop your images (with Preview) before you paste them in iWeb. Don't use mask, Unmask an image if it's masked. That's the trick!
    !http://i32.servimg.com/u/f32/09/02/44/99/unmask10.jpg!
    (* images with transparency areas (ex : some PNG and GIF), rotation and shapes in iWeb make also PNG files in your website.)

  • I cannot display image (read from oracle BLOB field) on browser?

    I cannot display image (read from oracle BLOB field) on browser?
    Following is my code, someone can give me an advise?
    content.htm:
    <html>
    <h1>this is a test .</h1>
    <hr>
    <img  src="showcontent.jsp">
    </html>showcontent.jsp:
    <%@ page import="com.stsc.util.*" %>
    <%@ include file="/html/base.jsp" %>
    <% 
         STDataSet data = new STDataSet();
    //get blob field from database     
         String sql = "SELECT NR FROM ZWTAB WHERE BZH='liqf004' AND ZJH='001'";
         //get the result from database
         ResultSet rs = data.getResult(sql,dbBase);
         if (rs!=null && rs.next()) {
              Blob myBlob = rs.getBlob("NR");
              response.setContentType("image/jpeg");//
              byte[] ba = myBlob.getBytes(1, (int)myBlob.length());
              response.getOutputStream().write(ba);
              response.getOutputStream().flush();
         // close your result set, statement
         data.close();     
    %>

    Don't use jsp for that, use servlet. because the jsp engine will send a blank lines to outPutStream corresponding to <%@ ...> tags and other contents included in your /html/base.jsp file before sending the image. The result will not be treated as a valid image by the browser.
    To test this, type directly showcontent.jsp on your browser, and view it source.
    regards

  • Displaying Tiff Image on browser

    Hi friends ,
    I want to display tiff image on browser . For that i have written one servlet witch will desplay tiff image on browser
    Here i am sending my code snippets for servlet.
    Here file is source file which i want to display.
    FileSeekableStream ss = new FileSeekableStream(file);
              ImageDecoder tiffDecoder= ImageCodec.createImageDecoder("tiff", ss, null);;
              p = tiffDecoder.getNumPages();
              for(int x=0;x<p;x++){
              RenderedImage tiffPage = tiffDecoder.decodeAsRenderedImage(x);
              ByteArrayOutputStream stream = new ByteArrayOutputStream();
         TIFFEncodeParam tiffOptions = new TIFFEncodeParam();
         // You may want to set compression or tile attributes on the     EncodeParam here
         RenderedOp l_return = JAI.create("encode", tiffPage, stream,"TIFF", tiffOptions);
         bt = stream.toByteArray();
    then writing this byte array(bt)
    OutputStream out;
    out.write(bt);
    and responce .setContentType("image/tiff");
    i also want to know whether mime type image/tiff is supported or not in servlet.
    When i run servlet i am getting File Downloading dialog box.
    also when i download image file it's size is very large than original.
    Plz correct my code.It's verry urgent.
    Thanks in Advance

    hi, could you post the solution?
    I'm looking forward to know the solution.
    Thanks

  • The safari software will not display images (pictures).  I have done the "reset" but still no help.  What should i try next?

    the safari software will not display images (pictures).  I have done the "reset" but still no help.  What should i try next?

        Safari > Preference > Advanced
        Checkmark the box for "Show Develop menu in menu bar".
        "Develop" menu will appear in the Safari menu bar.
        Click Develop and make sure that"Disable Images" is not enabled in the dropdown.

  • How to display "Image" object in the browser?

    can anyone please tell me how can i display "Image" object in the browser?
    I have an image object that i retrieved from AS400 BLOB object by using toolbox.jar (for as400 access for java including all necessary classes like jdbc driver, security etc.).
    i want to display this object in the browser so i will be able to web-enable my BLOB objects stored on as400.thx...

    In your HTML:
    <img src="ImageServlet">
    In ImageServlet:
    Make calls to DB to get your image as byte array and store it in:
    byte[] buffer = new byte[imageSize];
    ServletOutputStream out = response.getOutputStream();
    for(int i = 0; i < imageSize; i++)
    out.write(buffer, i, 1);
    out.close();

  • Very freaky, image in browser is not what's displayed

    I was planning on doing a little organization in Aperture, and it seemed images
    were out of place, as not in the right album.
    Then clicking on image in browser to move it, discovered it's not the same displayed is really weird.
    I quit the application before adding any from memory card that I was about to load in.
    I'm at a loss as to what to perform w/o messing up the whole thing.
    If more details are needed, feel free to inquire.
    Thanks

    Wow, now that link was hidden therapy. What a Nice Tour.
    The menu's language at Aperture are so tech writer challenged, for me anyway.
    If I ever get around to writing a third party program or scrip,
    I'd love to create an add on to take every drop down menu item and
    create a hovered cloud explanation as to what's going to happen if it's clicked.
    At 50 something, it would make my day.
    Maybe loading Aperture on a separate drive, and just slam through the gears to see
    what happens vs doing burn outs on existing image files.
    The built in manual I'm afraid is not reader friendly.
    Thanks Much.
    Phil

  • Help with displaying images (gif, jpeg...) within a JFrame (or similar)

    Hi all,
    i'm new to the forum and i'll be granted if you kind gentlemen/women could use some advices for my gui home application.
    My purpose is to display a static image in a container (i'd prefer to use javax.swing objects, but if you think that java.awt is more suitable for my app, please feel free to tell me about...). I used a modified code from one of the Java Tutorial's examples, tht actually is an applet and displays images as it is using the paint() method. I just can't realize how to set the GraphicContext in a JFrame or a JPanel to contain the image to display, without using applets. Following part of the code I use (a JButton will fire JApplet start, JApplet is another class file called Apple.java):
    class DMToolz extends JFrame {
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;
         private JButton jButton = null;
         private JComboBox jComboBox = null;
         private JMenuItem jMenuItem = null;
         private JMenuBar jJMenuBar = null;
         private JMenu jMenu = null;
         private JMenu jMenu1 = null;
         public int w=10, h=10;
         public String filename;
          * @throws HeadlessException
         public DMToolz() throws HeadlessException {
              // TODO Auto-generated constructor stub
              super();
              initialize();
         public DMToolz(String arg0) throws HeadlessException {
              super(arg0);
              // TODO Auto-generated constructor stub
              initialize();
          * This method initializes jButton
          * @return javax.swing.JButton
         private JButton getJButton() {
              if (jButton == null) {
                   jButton = new JButton();
                   jButton.setBounds(new Rectangle(723, 505, 103, 38));
                   jButton.setText("UrcaMado'");
                   jButton.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
    /**************SCRIVERE QUI IL NOME DEL FILE CON L'IMMAGINE DA CARICARE*******************/
                             filename = "reference table player2.gif";
                           java.net.URL imgURL = DMToolz.class.getResource("images/"+filename);
                           BufferedImage img = null;
                           try {
                                img =  ImageIO.read(imgURL);
                               w = img.getWidth();
                               h = img.getHeight();
                               System.out.println("*DM* Immagine letta - W:"+w+" H:"+h);
                            } catch (Exception ex) {System.out.println("*DM* Immagine non letta");}
                           JApplet a = new Apple();
                           a.setName(filename);
                           JFrame f = new JFrame ("UrcaBBestia!");
                           f.addWindowListener(new WindowAdapter() {
                               public void windowClosing(WindowEvent e) {System.exit(0);}
                           f.getContentPane().add(a);
                           f.setPreferredSize( new Dimension(w,h+30) );//30 � (circa) l'altezza della barra del titolo del frame
                               f.pack();
                             f.setVisible(true);                      
              return jButton;
    public class Apple extends JApplet {
         private static final long serialVersionUID = 1L;
        final static Color bg = Color.white;
        final static Color fg = Color.black;
        final static Color red = Color.red;
        final static Color white = Color.white;
        public void init() {
            //Initialize drawing colors
            setBackground(bg);
            setForeground(fg);
        public void paint(Graphics g) {
            Graphics2D g2 = (Graphics2D) g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            try {
                 String filename = this.getName(); //uso il nome dell'applet come riferimento al nome del file da caricare
                 java.net.URL imgURL = DMToolz.class.getResource("images/"+filename);
                 BufferedImage img =  ImageIO.read(imgURL);
                 if (img.equals(null)) {System.out.println("IMG null!");System.exit(0);}
                System.out.println("IMG letta");
                int w = img.getWidth();
                int h = img.getHeight();
                resize(w,h);
                g2.drawImage(img,
                            0,0,Color.LIGHT_GRAY,
                            null);// no ImageObserver
             } catch (Exception ex) {ex.printStackTrace();
                                          System.out.println("Immagine non letta.");System.exit(0);}
    }//end classPlease never mind about some italian text, used as reminder....
    Thanks in advance.

    Read the Swing tutorial on "How to Use Labels" or "How to Use Icons" for working examples:
    http://java.sun.com/docs/books/tutorial/uiswing/TOC.html
    By the way you should never override the paint() method. Custom painting (not required in this case) is done by overriding the paintComponent(...) method in Swing. Overriding paint() is an old AWT trick.

Maybe you are looking for