Rendering images dynamically using JEditorPane

My objective is to generate and render an image/css dynamically and I am using Swings -> JEditorPane
However, JEditorPane does not seem to be rendering CSS properly. Is this a known issue? Is there a fix?
Is there any other alternative?

Here is the scriplet I tried. But it is not redering the image and definitely I am missing something here. Please suggest changes or any direction.
<%
File f = image.getThumbnailFile(); //image file from a bean
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
InputStream inputStream = new FileInputStream(f);
byte[] bytes = new byte[1024];
int read;
try{
          while ( (read = inputStream.read(bytes)) > -1 )
                  byteOutput.write(bytes, 0, read);
          //byte[] ba = byteOutput.toByteArray();
          ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOutput.toByteArray());
          response.setContentType("image/gif");                       
          while ( (read = byteInput.read()) > -1 )          
               response.getOutputStream().write(read);
          response.getOutputStream().flush();
catch(Exception e){}                           
%>

Similar Messages

  • Rendering images dynamically from file server path

    Hi,
    We are having JDeveloper 11.1.2.4
    We have following requirement - Image files are located on server. File locations (path and name) are stored in database table.
    We need to dynamically access file locations from database table, access file from server and render it in ADF image component.
    Is it possible? If yes, we would really appreciate some pointers/help on how to achieve it.
    Please note that we are able to render images dynamically when they are stored in database BLOB column. We can do that using a ImageServlet class. In doGet() method, we are fetching the database BLOB column based on current row id.
    Thanks,
    Vivek

    Here is the scriplet I tried. But it is not redering the image and definitely I am missing something here. Please suggest changes or any direction.
    <%
    File f = image.getThumbnailFile(); //image file from a bean
    ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
    InputStream inputStream = new FileInputStream(f);
    byte[] bytes = new byte[1024];
    int read;
    try{
              while ( (read = inputStream.read(bytes)) > -1 )
                      byteOutput.write(bytes, 0, read);
              //byte[] ba = byteOutput.toByteArray();
              ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOutput.toByteArray());
              response.setContentType("image/gif");                       
              while ( (read = byteInput.read()) > -1 )          
                   response.getOutputStream().write(read);
              response.getOutputStream().flush();
    catch(Exception e){}                           
    %>

  • HOW DO I MAKE IMAGES DYNAMIC USING DREAMWEAVER & MySql

    Hi there,
       I wanted to make images dynamic in that the images would be stored in my database and then use dreamweaver to pull the images from the database using a recordset. But how do I get to store the images in MySql now that dreamweaver doesn't support BLOB and also how do I make dreamweaver pull the images from that database? PLZ somebody help

    To pull the image from Database on to your page
    1. Open your php page
    2. put your cursor where you want the image to show on the page
    3. insert>image>Select File Name From: Data Sources>select record from recordset> click ok
    4. View in browser
    In Mysyl the image was stored as a "longblob" type with "binary" attributes
    but my system is Dreamweaver CS3.
    Hope this helps. Let me know.

  • How to render image dynamically in ADF using URL

    Hi all,
    I have a requirement where i need to render the images dynamically using the url. As the url are of the IPM Application and each of the url is associated to a particular image of a particular document. I have tried making the URL Data Control but couldn't able to get the Image as per the document,even the image is not being rendered onto the page.I want the whole IPM console to be rendered on my jspx page.
    Note- It is not a wsdl url.
    Please suggest how should i implement this
    thanks in advance

    if you decompile the imaging.ear file, there is a web.xml file which you can add the following parameter:
    <context-param>
    <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
    <param-value>never</param-value>
    </context-param>
    or take a look at      Receiving "Warning: Unable to load content in a frame. Frame content will load at the top level." When Trying to Use the <af:inlineFrame> Component [ID 1266770.1] on Oracle Support.
    Make sure you take a copy of the imaging app before you make changes. You can then upload back through the weblogic console.
    Sudi

  • Facing problem in using JEditorPane as renderer for JList

    I am trying to use JEditorPane as renderer for a list. But I am facing some problems. First problem is the output in the editorpane is not shown properly. I want to show a html file, but only portion of the first line that is viewable in the editorpane is shown. I, of course, need to show the total content of the file. Again sometimes the editorpane looks blank. If I click on the list then some text are shown in the editor pane. Please help me to overcome these problems.
    Here goes the code for the renderer.
    list.setCellRenderer(new ListCellRenderer() {
                private JEditorPane editor = new JEditorPane();
                public Component getListCellRendererComponent(JList mList, Object value, int index,
                                                            boolean isSelected, boolean hasFocus) {
                    try {
                        editor.setPage("file://localhost/C:/networks/network1/description.html");
                        editor.setBackground(isSelected ? mList.getSelectionBackground() : mList.getBackground());
                        editor.setForeground(isSelected ? mList.getSelectionForeground() : mList.getForeground());
                        editor.setBorder(BorderFactory.createRaisedBevelBorder());
                        editor.setOpaque(true);
                    } catch(Exception e) {
                        e.printStackTrace();
                    return editor;
            });

    hai ahmad,
    it could be bcoz of the size of the pane.... the size content might be too large to fit in that pane....... y dont u increase the width of the pane..
    or set the size of the pane..... its surely bcoz of the size only....
    hope this helps u...... or else revert back for further clarifications...
    Regards,
    Ciya.

  • Adding Image to Simple Button Dynamically Using AS3

    Hi,
    I need some help trying to figure out how to dynamically add an image (PNG or JPEG) that I can place in the library to a simple button also dynamically created in AS3.
    Is there a way to (1) add the image instead of using a text label and have it centered in the button?
    Here's the AS3 for the simple button without the image (currently uses text label but would prefer if possible to substitute an image for the text:
            var mc2:MovieClip = new MovieClip();
            mc2.addChild( bgRed2 );
            mc2.addChild( txt2 );//currently uses text label; would prefer to use an image istead of text
            var mc2a:MovieClip = new MovieClip();
            mc2a.addChild( bgRed2a );
            mc2a.addChild( txt2a );currently uses text label; would prefer to use an image istead of text
            var clearBtn:SimpleButton = new SimpleButton();
            clearBtn.upState = mc2;
            clearBtn.overState = mc2a;
            clearBtn.downState = clearBtn.upState;
            clearBtn.hitTestState = clearBtn.upState;
            clearBtn.x = 0;
            clearBtn.y = 0;
            addChild( clearBtn );
            clearBtn.x = 55;
            clearBtn.y = stage.stageHeight-clearBtn.height;
    Any help appreciated.

    assign your image a class name (eg, Img1). you can then use:
    var img1D:BitmapData=new BitmapData();
    var img1:Bitmap=new Bitmap(img1D);
    cleanBtn.upState=img1; // for example, button's upstate is the image.
    // if you wanted some background and the image centered on the background, create your background (sprite or movieclip), use addChild to add img1 to your background and center it.  then assign your button's upState etc to be your background

  • Error - Rendered Image is NULL

    Hello !
    I am trying to work on animated objects. I have imported XMII Dynamic Graphics from sdn website and imported the same in my project.
    Now when I am tyring to use HorizLEDMeter or any of its object I am getting the error as  "Rendered Image is null".
    Can anyone please tell me what can be the solution for this ??
    Thanks.

    Please use the latest service pack. I was facing the same problem and after application of service pack, the problem was resolved
    Regards,
    Musarrat

  • 'Could not create the file...' 'Access was denied.' and 'Cannot close a closed file.' Errors When Rendering Image Sequence

    Hello,
    I am getting the below error messages when I render a TIFF image sequence using default settings. I have double-checked and I have read-write privileges for the file destination. I have also emptied the Disk Cache and Cleaned the Database. My system set-up is also below - there was no error log. Any help/ideas would be greatly appreciated as this keeps happening.
    My Computer
    Windows 7 Professional Service Pack 1, 64-bit
    Intel Xeon CPU E5-2697 v2 @ 2.7 GHz
    64 GB RAM
    After Effects
    2014.2
    Render Settings
    After Effects Multiprocessing ON (I tried it with and without)
    Disk Cache Enabled
    Default TIFF Sequence with Alpha Output Module

    Google Drive? Directly rendering to a synced folder? This cannot work.
    Mylenium

  • How to set a jpg image ContentType of JEditorPane

    Hi how can i display an image on a JEditorPane like image.jpg?
    I tried myEditor.setContentType("image/jpeg") but it still displays characters instead of the image.
    import java.awt.*;
    import javax.swing.*;
    import java.io.*;
    public class Pagina extends JFrame implements Runnable {
         JEditorPane e;
         public Pagina(){
              super("fds");
              e = new JEditorPane();
              e.setEditable(false);
              e.setContentType("image/jpeg");
              Container c = getContentPane();
              c.add(e);
              setSize(400,400);
              setVisible(true);
              Thread t = new Thread(this);
              t.start();
         public void run(){
              while(true){
                   try{
                   e.setPage( "http://10.0.0.5/SnapShot.jpg" );
                   Thread.sleep(1000);
              catch(IOException ioe){}
              catch(InterruptedException ie){}
         public static void main (String [] args) {
              new Pagina();
    }

    In your current app, you are trying to redisplay an image in some infinite loop. This smells bad to me. I am no expert in java graphics, far from it, but if you want to paint a background image within a JEditorPane, since JEditorPane is a component and has to paint itself, you could override its paintComponent method and draw an image inside there using the Graphics object.
    another way is to put the JEditorPane on top of a JPanel that draws your picture. In both instances, I think that you'll need to set the JEditorPane's opaqueness to "false".
    Something like so, perhaps?
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.BorderFactory;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    class ImageJEditorPane extends JPanel
        private static final String IMAGE_FILE1 = "disc/d1/f/image1.jpg";   
        private static final String IMAGE_URL = "http://10.0.0.5/SnapShot.jpg";
        private BufferedImage myImage = null;
        private JEditorPane editorPane;
        ImageJEditorPane()
            try
                setPreferredSize(new Dimension(800, 650));
                setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
                setLayout(new BorderLayout());
                //myImage = ImageIO.read(new File(IMAGE_FILE1));
                myImage = ImageIO.read(new URL(IMAGE_URL));
                editorPane = new JEditorPane()
                    @Override
                    protected void paintComponent(Graphics g)
                        g.drawImage(myImage, 0, 0, null);
                        super.paintComponent(g);
                editorPane.setPreferredSize(new Dimension(1200, 1000));
                editorPane.setOpaque(false);
                JScrollPane scrollPane = new JScrollPane(editorPane);
                add(scrollPane, BorderLayout.CENTER);
            catch (IOException e)
                e.printStackTrace();
         //or you could do it this way
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            g.drawImage(myImage, 0, 0, null);
        private static void createAndShowGUI()
            JFrame frame = new JFrame("ImageJEditorPane Application");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.getContentPane().add(new ImageJEditorPane());
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        public static void main(String[] args)
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
    }Edited by: Encephalopathic on Dec 21, 2007 3:09 PM

  • Proble displaying images dynamically in jsp

    Hi, I am new here. I have to display the images dynamically reading from a database. I have no problem displaying images. When i try to reduce the width in img tag then it is slowly rendering it. How to overcome this.
    <img src="image.jsp?imgID=112" width="150" heigth="130" border="0">
    I am also giving the sample jsp to display
         byte [] imgData = blob.getBytes(1,(int)blob.length());
    response.setContentType("image/jpeg");
    OutputStream o = response.getOutputStream();
    o.write(imgData);
    I want to display the image without any time taken. How could I solve this. Please Help me.
    Thanks.
    Phani.

    You should not crosspost questions. It is rude and a waste of our time.
    Please stick to one topic: [http://forums.sun.com/thread.jspa?threadID=5372144].

  • How to add Image dynamically in Webdynpro ABAP

    Hi Experts,
    How to add Image dynamically in Webdynpro ABAP.
    My requirement is i maintain all the images in a table.
    image source has to pick the table URl dynamically and display.
    is that possible in webdynpro?
    and also please give the suggesion,
    without using MIME objects is that anyway to get images?
    Thanks in advance.
    Regrads,
    Jeyanthi

    Hi,
      are those icons wou want to display then. he following code will be useful.
    data : lo_IMG type ref to CL_WD_IMAGE.
    LO_IMG = cl_wd_IMAGE=>new_IMAGE( id = img_id SOURCE = 'ICON_BW_APD_TARGET' tooltip = sts_tltp ).
    lo_cont->add_child( the_child = lo_img ).
    here lo_cont is the container where you want to add the image dynamically and source is the attribiute through which you can change the ICON image. this thing you can getit from data base table and change accordingly.
    Regards,
    Anil kumar G

  • Rendering Image in JPanel

    Hi,
    I am completely new to java imaging and I am planning to build a small image viewer application (something similar to the comic book reader).
    After some search and following the discussion here [http://forum.java.sun.com/thread.jspa?forumID=20&threadID=362429|http://forum.java.sun.com/thread.jspa?forumID=20&threadID=362429] , I have main app consists of JFrame with SplitPane which consists a ScrollPane. In separate class, I have JPanel class. I am trying to add the JPanel in ScrollPane when application starts. JPane is responsible for fetching and rendering image but something went wrong and it is giving me a NullPointer Exceptions. So far I was able to figure out that it is causing by the "paintComponent" method but no idea why. I am looking for a nice suggestions and guidance on this topic (especially something like why it didn't work and various ways to do things). "For Dummies" style suggestions are highly appreciated.
    Follwing are my two classes:
    ===============================
    =======================
    Separate JPanel Class
    =======================
    * JPanelCanvas.java
    * Created on July 17, 2008, 4:16 PM
    package org.zeenet.bookreader;
    * @author  Deepak K. Shrestha
    import java.awt.*;
    import java.awt.image.*;
    import javax.imageio.*;
    import java.io.*;
    public class JPanelCanvas extends javax.swing.JPanel {
        BufferedImage prevImg, currImg, nextImg = null;
        Graphics g;
        /** Creates new form JPanelCanvas */
        public JPanelCanvas() {
            initComponents();
            getImage();
            setSize();
            paintComponent(g); //<<<<-- so far this is causing the trouble <<<<
        //fetch image from file
        public void getImage() {
           try {
               currImg = ImageIO.read(new File("D:\\TEMPORARY\\logo.JPG"));
           } catch (IOException e) {
        public void setSize() {
            if (currImg == null) {
                 this.setPreferredSize(new Dimension (100,100));
            } else {
               this.setPreferredSize(new Dimension(currImg.getWidth(null), currImg.getHeight(null)));
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            g.drawImage(currImg, 0, 0, null);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 400, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 300, Short.MAX_VALUE)
        }// </editor-fold>                       
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }==========================
    Main application
    ==========================
    * JFrameReader.java
    * Created on July 16, 2008, 3:16 PM
    package org.zeenet.bookreader;
    import javax.swing.*;
    * @author  Deepak K. Shrestha
    public class JFrameReader extends javax.swing.JFrame {
        /** Creates new form JFrameReader */
        public JFrameReader() {
            initComponents();
            setExtendedState(JFrameReader.MAXIMIZED_BOTH); //maximize application
            jScrollPaneCanvas.add(new JPanelCanvas()); //<<<<---attached the JPanel here <<<<<<<<<
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            jLayeredPane1 = new javax.swing.JLayeredPane();
            jSplitPane1 = new javax.swing.JSplitPane();
            jScrollPaneCanvas = new javax.swing.JScrollPane();
            jScrollPaneList = new javax.swing.JScrollPane();
            jListItem = new javax.swing.JList();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("zeeBookReader");
            jSplitPane1.setRightComponent(jScrollPaneCanvas);
            jListItem.setModel(new javax.swing.AbstractListModel() {
                String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
                public int getSize() { return strings.length; }
                public Object getElementAt(int i) { return strings; }
    jScrollPaneList.setViewportView(jListItem);
    jSplitPane1.setLeftComponent(jScrollPaneList);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
    .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 264, Short.MAX_VALUE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
    pack();
    }// </editor-fold>
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new JFrameReader().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JList jListItem;
    private javax.swing.JScrollPane jScrollPaneCanvas;
    private javax.swing.JScrollPane jScrollPaneList;
    private javax.swing.JSplitPane jSplitPane1;
    // End of variables declaration
    =======================
    By the way I am using Netbeans and all swing components are created using GUI editor.
    Trying to build this app gives me following error:
    ===========================================
    init:
    deps-jar:
    compile:
    run:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.JComponent.paintComponent(JComponent.java:766)
    at org.zeenet.bookreader.JPanelCanvas.paintComponent(JPanelCanvas.java:54)
    at org.zeenet.bookreader.JPanelCanvas.<init>(JPanelCanvas.java:30)
    at org.zeenet.bookreader.JFrameReader.<init>(JFrameReader.java:22)
    at org.zeenet.bookreader.JFrameReader$2.run(JFrameReader.java:80)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    BUILD STOPPED (total time: 10 seconds)
    ===============================================
    Thanks

    You should not call paintComponent explicitly (especially with a null Graphics object).
    It is called internally when the component needs to repaint itself.
    Read this: [Performing Custom Painting|http://java.sun.com/docs/books/tutorial/uiswing/painting/]

  • How to change the image dynamically depend upon the input parameter

    Hi All
    I have one report running depend upon the Organization specific, I have 15 operating unit and 15 different logo for each operating unit.
    How to change the Logo dynamically depend upon the input passed by the user.
    If I have three or four logo i can add in my layout using if else statement and its works fine but i have more that 10 logos so its no possible to keep these in My RTF Template.
    Is it possible to change the logo according to the input without keeping this in Template.
    I have seen this link but its not working fine
    http://erpschools.com/articles/display-and-change-images-dynamically-in-xml-publisher
    Regards
    Srikkanth.M

    Hi,
    I have not completed fully,so sorry i cant able to share the files, could you please give me some tips and steps to do.
    Without having the logo in RTF if it possible to bring the logo depends on the user input (Ie Operating unit).
    Regards
    Srikkanth

  • Rendering images based on BLOB columns

    Hello
    I'm using JDevelpor 10G ..
    I want to render image from BLOB column , and its the first time working with servlet , I read this article
    http://www.pascalalma.net/2008/04/22/oracle-adf-medior-rendering-images-based-on-blob-columns/
    and I want to ask some questions ??
    - How can I check that the servlet is run .. I use this to call the servlet "" Do not laugh .. I am really new "
    <af:objectImage source="/render_image?img_id=#{row.ImageId}"/>
    You should read the article to understand my question
    rgds

    done , my problem was with mapping
    If you have any problem with this case I can help
    contact me
    [email protected]

  • How to embed images dynamically?

    HI all , I'm new to flex.
    Here is what I've already done, I use
    [Bindable]   
    [Embed(source="images/xxx.jpg")]
    private var img:Class;
    to embed several images in an application.
    But the source of these images can not be determined until the run time, I got image's url dynamically, and used some variables to store them. For example, an url may refers to an url
    var url:String = "images/xxx.jpg";
    Then I think it's possible to give its value to an image source by using
    [Bindable]   
    [Embed(source=url)]
    private var img:Class;
    However,it doesn't work. there is a compile error, the description is:
    "url" does not have a recognized extension, and a mime type was not provided
    Unable to transcode url
    So what's the problem here, and could any one give me some advice to embed images dynamically?
    Thanks!

    HI
    I don't think you can embed an image dynamically as you need to know the path of the image when you use the embed tag.  The embedding takes place at compile time, and you app would need to be compiled into a swf before your code loads.
    If you need dynamc images in an application then its usually done by loading them when the app is running.  You do this by using for example a HTTP service to load in the image paths.  You can then view them by assigning them to an image tag through Actionscript.
    I hope that helps and I got the idea of what you were trying to do.
    Heres a quick example I used for someone else on swapping images from an arrayCollection.  You could do something like this and populate the arrayCollection using a HTTP service.  Or just access the xml from the HTTP directly for the image paths
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()" xmlns:local="*">
         <mx:Script>
              <![CDATA[
              import mx.controls.Button;
              import mx.collections.ArrayCollection;
    [Bindable]
    private var ac:ArrayCollection = new ArrayCollection([
    {imageTitle : 'Car 1', imageUrl : 'http://www.geekologie.com/2007/12/07/future-car-1.jpg'},
    {imageTitle : 'Car 2', imageUrl :'http://www.speedace.info/solar_cars/solar_car_images/Solar_Wing_front_Japanese_e lectric_powered_car.jpg'},
    {imageTitle : 'Car 3', imageUrl : 'http://www.dezeen.com/wp-content/uploads/2008/09/gem-peapod-car-by-chrysler-llc- et008_027evsqu.jpg'}
    private function showCar(num:int):void {
    img.source = ac.getItemAt(num).imageUrl;
    imgTitle.text = ac.getItemAt(num).imageTitle;
    ]]>
         </mx:Script>
         <mx:Image id="img" source="{ac.getItemAt(0).imageUrl}" width="426" height="243"/>
         <mx:Label id="imgTitle" text="{ac.getItemAt(0).imageTitle}"/>
         <mx:Button label="Button" click="showCar(0)"/>
         <mx:Button label="Button" click="showCar(1)"/>
         <mx:Button label="Button" click="showCar(2)"/>
    </mx:Application>
    Good luck
    Andrew

Maybe you are looking for

  • Code to 2 DSO fields in 'Customer Exit'

    Hello, For my Customer Exit code, I want to read 2 fields (BEG_FORPER & END_INPER) from DSO 'ZHRPY_O50' & append them to 'Customer Exit' variable 'ZACTDATE'. Could someone help me with this code? Thanks!

  • Indesign cs5.5 Applescript - Relink image

    Hi, currently we can relink images from our applescript by using the original image link name but looking to see if we can do if by script label name.  Is this possible.  Thanks, Joe

  • PCR Application - RFCs

    Hi, I opened the Webdynpro application mss/pcr and found 3 RFCs. HRWPC_RFC_PCR_GET_SCENARIOS - returns the PCR scenario ids available for the user. HRWPC_RFC_GET_OBJECTS (dunno what this is for) ISR_LAUNCHPAD_SCENARIO_CHECK (dunno what this is for) M

  • Time Machine and IOMega StoreCenter

    have a 500G boot drive. I'm trying to use Time Machine to backup to an external drive. The drive is an IOMega 1T StoreCenter connected to the Mac via Firewire. The OS is OSX Server 10.5.6. I erase the drive and start activate Time Machine. It backups

  • When I try to play Free cell on Candystand, it says to click on button below. There isn't a button

    <blockquote>Locking duplicate thread.<br> Please continue here: [[/questions/881151]]</blockquote> ''''''The question is pretty obvious. When I sign of to play solitaire, free cell and Klondike, it says to start. click on button below. I can't find a