How to display images in the Personal Java?

Guys,
please help me to display the images in gif format in the standalone application using PersonalJava.
with regards,
Amin

JDK:1.1.8; Personaljava:1.1Beta
Following is my program,it can not only display image but also scroll image that biger than Panel or Canvas.
import java.awt.*;
import java.awt.event.*;
//ImageCanvas object is container keeping Image
class ImageCanvas extends Canvas
private Image image,errorimage;
Container pappy;
public ImageCanvas(Image i,Container parent)
errorimage = Toolkit.getDefaultToolkit().getImage("error.gif");
image=i;
pappy = parent;
//following 5 lines can make image display smoothly
MediaTracker tracker = new MediaTracker(this);
tracker.addImage(image, 0);
try { tracker.waitForID(0); }
catch (InterruptedException e) {}
public void paint(Graphics g)
if(image.getWidth(this)==-1)
image=errorimage;
Dimension d = getSize();
this.setSize(image.getWidth(this),image.getHeight(this));
//Critical syntex for refresh container
pappy.layout();
pappy.repaint();
g.drawImage(image, 0, 0,this);
public class ScrollingImage implements ActionListener
{   Frame frame;
ScrollPane sp;
Image im;
public static void main(String[] args)
ScrollingImage tests= new ScrollingImage();
tests.go();
public void go()
frame = new Frame();
frame.setLayout(new BorderLayout());
sp = new ScrollPane();
im =Toolkit.getDefaultToolkit().getImage("001.gif");
//please notice following line,critical syntex to display image,I took 2 days to find it.
sp.add(new ImageCanvas(im,sp));
sp.setSize(240,290);
frame.add(sp, BorderLayout.CENTER);
//following 5 lines make frame be able to close
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
frame.pack();
frame.setVisible(true);

Similar Messages

  • How to display image in the smartforms

    Hi All,
    I have image conent in the Binary formate.I want to dispaly that image in the smartforms.
    Please tell me how to display that image in the smartforms dynamically.
    Normally wa uploaded in SE78.And that is used in smartforms.But this is static way.
    I want to display tha images dynamically.
    Please Please
    Thanks,
    Saritha

    Hi,
          The image is in the DB ,right..Its in Binary format..
    See first we want the picture to be get uploaded inside the SAP.It is done by se78..
    If possible we can retrieve the picture outside in a place means we can get tht into sap by using
    Call Transaction 'SE78'.
    Reward if useful ...........

  • How to display image in the view

    hi friends
    I created one small webdynpro application it contains one default view.
    Now I want display one image on that view.(image is located in my local machine)
    i am new to webdynpro
    help me out.
    thanks
    ram.

    hi,
    refre the following link.
    http://help.sap.com/saphelp_nw70/helpdata/EN/f3/1a61a9dc7f2e4199458e964e76b4ba/frameset.htm
    Upload Image file from system in Web dynpro view
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0e599cc-2862-2b10-54a9-dcf1376b52d7
    Dynamic images in Web Dynpro for Java applications
    Dynamic images in Web Dynpro for Java applications
    Thanks
    Abhilasha
    Edited by: Abhilasha Dahare on Sep 17, 2008 6:24 AM

  • How to display image on the welcome page of a workset.

    Hello Experts,
    I have company image in KM docs.
    MasterRole on top level navigation.
    Then I have subrole.
    When I click on the sub role. It directly open the first iview contained in the workset.
    Here, I want to display a imagelike a welcome image  instead of the first iview.
    The user can navigate to his choice of view after seeing this image. can any post a document on how to do it?
    I am on EP 7.0 portal.
    Thanks in anticipation,
    Raj

    Thanks for information on workset mpa iview. But, at our client. They have assigned Iview directly to a role.
    Also, I have created the KM iview as url iview . When I preview it, it works fine.
    I have added that iview to the folde runder the role where i want this iview to show up as entry point.
    I changed the properties invisible in navigation (yes) and set as entry point (yes).
    But, it is giving me the following error. Page can not be found and in logs
    Meta name for property
    ID cop:cop_search_resourcetype can not be created.
    No namespace mapping for the given namespace alias.
    Null will be returned!

  • How to display image?

    Hi all,
    How to display image from the database table in the adobe form by using web dynpro abap?
    I want to display image in the adobe interactive form by using web dynpro abap.
    Please help me.
    Regards,
    srini

    Hi Srini,
    If you go through the article you might have seen the following piece of code
    *** Send the values back to the node
      lo_el_z_if_test_cv->set_static_attributes(
        EXPORTING
          static_attributes = ls_z_if_test_cv ).
    " here ls_z_if_test_cv has the image in XSTRING format which has beeen retrived using METHOD get_bds_graphic_as_bmp of CLASS cl_ssf_xsf_utilities
    " In  your case you need to just use the select query n fetch it from your table; ( provided your image is store in XSTRING format )
    How is your image stored in your database table ?
    Regards,
    Radhika.

  • Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?

    Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?
    I am acquiring images and data to a buffer on the edge of the while loop, and am finding that the crashing of the program is unpredictable, but almost always due to a memory saturation when the buffers gets too big.
    I have attached the VI.
    Thanks for the help
    Attachments:
    new_control_and_acquisition_program.vi ‏946 KB

    Take a look at this document that discusses how to monitor IMAQ memory usage:
    http://digital.ni.com/public.nsf/websearch/8C6E405861C60DE786256DB400755957
    Hope this helps -
    Julie

  • Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisitio​n VI to predict when it is time to cease the acquisitio​n to prevent the program crashing?

    Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?
    I am acquiring images and data to a buffer on the edge of the while loop, and am finding that the crashing of the program is unpredictable, but almost always due to a memory saturation when the buffers gets too big.
    I have attached the VI.
    Thanks for the help
    Attachments:
    new_control_and_acquisition_program.vi ‏946 KB

    got these vi's off ni site a while ago - see if they help
    Attachments:
    Memory_Monitor.zip ‏132 KB

  • How to display images and information

    how to display images and information(e.g. like questions) on a jsp page that stored in a database

    Look As far as i can see....
    Utlimately every file could be expressed as a bytes buffer.
    so say if you have a bean called Choice Bean which is expressed as
    public class ChoiceBean{
       private String choiceid;
       private String choicedesc;
       private byte image[];
       public void setChoiceId(String choiceid){
              this.choiceid = choiceid;
        public String getChoiceId(){
               return this.choiceid;
          public void setChoiceDesc(String choicedesc){
               this.choicedesc = choicedesc;
           public String getChoiceDesc(){
               return this.choicedesc;
           public void setImage(byte image[]){
                  this.image = image;
             public byte[] getImage(){
                  return this.image;
    }QuestionList.java:
    ===============
    public class QuestionList{
         private List<ChoiceBean> choicelist;
          /*Other member variable declarations*/
           public  List<ChoiceBean> getChoiceList(){
                    /*Custom code where you may build the list by querying the DA layer*/
                     return this.choicelist;
         public int search(String choiceid){
                 int index = -1;
                 for(int i =0 ; i < this.choicelist.size() ; i++){
                        ChoiceBean cb = this.choicelist.get(i);
                         if(cb.getChoiceId().equals(choiceid)){
                                index = i;
                                break;
                 return index;
        /* Other member method declarations */
    }and you are retreving List<ChoiceBean> from DB using your query & have created a session attribute / <jsp:useBean> named ChoiceList
    NOTE: sometimes your application server can go out of bounds as you are consuming a lot of memory by creating an arraylist object.
    use the following methodology to display images & choices
    sample.jsp:
    =========
    <jsp:useBean id="QuestionList"  class="com.qpa.dao.QuestionList" scope="session"/>
    <TABLE>
    <%
    /* QuestionList.getChoiceList() is a method which fetches data from the DB & returns it in form of  List<ChoiceBean> */
    List<ChoiceBean> choicelist = QuestionList.getChoiceList();
    for(int i =0 ; i < choicelist.size() ; i++){
    %>
    <TR>
    <TD><%!=choicelist.get(i).getChoiceId()%></TD>
    <!-- calling servlet which renders an images in JPG format based upon given choiceid(unique field) -->
    <TD><IMAGE src="ImageServlet?choiceid=<%!=choicelist.get(i).getChoiceId()%>"/> </TD>
    <TD><%!=choicelist.get(i).getChoiceDesc()%></TD>
    </TR>
    <%
    %>
    </TABLE>
    <%
        session.remove("QuestionList");
    %>
    NOTE: usage of JSTL or any other custom built tag-libraries makes life more simpler in the following case
    ImageServlet.java:
    ===============
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            byte buffer[] = null;
            HttpSession session = request.getSession(false);
            /*getting the QuestionList from the session*/
            QuestionList ql = null;
            String choiceid = new String("");
            try{
                 choiceid = request.getParameter("choiceid");
                 /*getting the QuestionList from the session*/
                ql = (QuestionList)  session.getAttribute("QuestionList");
            } catch(Exception exp){
            if(choiceid.equals("") == false &&  ql != null ){
                List<ChoiceBean> clist = QuestionList.getChoiceList();           
                   assuming that you have created a serach method which searches the entire choice list and would give you
                   the index of that object which is being refered by unique choiceid and returns -1 if not found
                int index =  QuestionList.search(choiceid);
                if(index != -1){
                   ChoiceBean cb = clist.get(index);
                   buffer = cb.getImage();
            if(buffer != null){
                 // assuming that we have stored images in JPEG format only
                 JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(new ByteArrayInputStream(buffer));
                 BufferedImage image =decoder.decodeAsBufferedImage();
                 response.setContentType("image/jpeg");
                 // Send back image
                 ServletOutputStream sos = response.getOutputStream();
                 JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
                 encoder.encode(image);
            } else {
               response.setContentType("text/html");
               response.getWriter().println("<b>Image data not found</b>");              
    }However,i still feel there are few loopholes with this approach where Application Server can eat up a lot of heap space which may result in outofmemorybound exception.
    Hope this might help :)
    REGARDS,
    RaHuL

  • How to store image in the oracle database 10.2.

    Hi.,
    I am working on 10g ids. I have designed a form where there are two fields. Name and picture.
    I want to keep details of the person with their photo.
    I can simply put name but how to insert image in the picture field??
    can you suggest ??
    Thanks.
    Shyam

    Hi
    To store your binary images in an Oracle database, you will need to create a column in your table defined with the BLOB datatype BLOB stands for Binary Large Object. Images from scanners, mpeg files, movie files and so on can all be stored in the BLOB column
    sq>CREATE TABLE test_table (
       id NUMBER,
       image BLOB);then go to
    [http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10796/toc.htm]

  • How to display images on my internal isight?

    Hi,
    I just bought the new iMac 2 gig dual. Running on 10.5.2.
    I wanted to know how to display images on my screen during a video conference chat without resorting to holding up a print out to the camera? I need something where I can switch from video mode to image mode and show a single image at a time if I need to. All that while still talking of coarse. If it isn't possible with my iSight software, can you point me to other software I can download and still use my built in cam?
    I hope I was clear enough in asking this.
    Thanks
    Liban

    Welcome to Apple Discussions, Liban
    iChat can do what you want, but I do not know of any web-based video chat site that can.
    Look for Help or Support information on the site you are using or ask the Webmaster if his site has the capability to do what you want.
    EZ Jim
    PowerBook 1.67 GHz w/Mac OS X (10.4.11) G5 DP 1.8 w/Mac OS X (10.5.2)  External iSight

  • 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

  • How to store images in database using java

    hii
    how to store images in database using java..........
    Message was edited by:
    naveennaga

    I asked a similar question once and the answer I got was - Don't.
    Instead, store the images on a drive somewhere and store the path in the database.
    But I'm no expert - that's just what I was told by someone who does this kind of stuff a lot.
    Hope that helps.

  • Displaying image in the Title bar

    hi ,
    can any one help me to display image in the JFrame Title Bar Left Corner, Right Corner, orMiddle ..

    double post http://forum.java.sun.com/thread.jsp?forum=57&thread=554453

  • How to display images real-time?

    How, (using CVI, NI-IMAQ and IMAQ Vision) can I duplicate the Grab function seen in MAX; in other words, I want to display images at the frame rate of my camera (30 fps). I've come across several examples on this site, the best of which seemed to be "Performing Real-time Image Acquisition, Averaging, and Logging" (realtime_image_averaging.zip), but this example, built with LabView, can't find several vi's (IMAQ WindDraw.vi, IMAQ Convert.vi, IMAQ Add.vi, IMAQ Divide.
    vi, IMAQ WriteFile.vi) needed to run it. I have LabView 5.1, NI_IMAQ 2.6 and IMAQ Vision for LabView 4.01). Please note that, although I'll accept LabView, I prefer a CVI solution.
    Thanks in advance for any help.
    'til next we type...
    Jesse

    I would strongly recommend upgrading to the current version of Vision. There have been major improvements since the version you have. I suspect the examples have improved significantly also, which would probably be worth the cost of the upgrade. I have attached a simple grab and display example in LabVIEW that I saved to LV 5, but I can't be sure it will work with the old version of Vision. Since you want to use CVI, it probably won't do you much good anyway.
    Bruce
    Bruce Ammons
    Ammons Engineering
    Attachments:
    HL_Grab_in_IMAQ_Vision_display.vi ‏36 KB

  • How to display images in a page?

    Hello
    I would like to show a specific image in the main page of my application. The images to display will be in a table in the database. The idea is that when a user login into the application, the main page shows the image associated and some links.

    Hello,
    You can put an HTML region on your page and then use img tags to display it....How are your images in the database? are they image.gif? or?
    Since your images are in a table, you could do some sql...
    select '(img src="server:port/dir/dir/' || IMG || '" alt="image"/)'
    from table
    where
    Remember to replace the ( with < and ) with >
    Hope this helps out some.
    -Chris

Maybe you are looking for

  • Error message when logging into imessage and facetime

    When I try logging into facetime and imessage on my ipod touch 4th gen, I get the following error message "the user name or password for "my email address" was incorrect. Try again." However I am able to log into apple id online, app store, game cent

  • How do I create optinal elements in a ID document?

    Hello ID community! I'm an ID beginner, and I'm trying to format a manual for a seminar. I have some icons that I'd like to be invisible in the student version of the manual, but be visible and printed in the teacher's version. (Basically they're jus

  • MacBook Pro - Boot Camp 5 - Windows 7

    I have a Mid 2010 MacBook Pro 13", running Mac OS X 10.8.4, Via Boot Camp 5 I also have Windows 7 64Bit on it. Now re-did it several times to always run into the same issue which; sound is not working and more imprtantly right-click via Trackpad not

  • Need help with a unique WMV export

    Hi, everyone! This is my first post on this board. I have a sequence in Final Cut Pro that is three 640x480 clips laid out end-to-end to make a 1920x480 movie. The total length of the program is 7-8 minutes. I am needing to export this from Compresso

  • TS3212 After downloading, I get this message: preparing disk image. How long does this take?

    I'm trying to download the latest version of iTunes, ITunes 10.7.dmg, on my Mac OSX 10.6.6. The update is stuck and the only message I read is "Preparing the disk image". What should I do?