Problem Displaying Images in a JFrame

I am writing a program that displays images on a JFrame window. I have been reading the other postings about this topic however I have not been able to make my code work. I am hoping there is some obvious solution that I am not noticing. Please help, I am very confused!
public class WelcomeWindow {
private JLabel label;
private ImageIcon logo;
public WelcomeWindow() {
label = new JLabel();
logo = new ImageIcon("/images/logo.gif");
label.setIcon(logo);
this.getContentPane().add(label);

Instead of a JLabel, have you tried to use a JButton containing the Icon?
Also (but I think you've done it already), you could do that :
File iconFile = new File("/images/logo.gif");
if (!iconFile.isFile()) {
System.out.println("Not a file");
That way you'll be certain that the path given is correct.
Hope this helps.

Similar Messages

  • Problem Displaying image from blob

    Hi all,
    I m using,
    Database : 10g Rel 2
    Frontend : DevSuite 10g
    OS : WinXp
    Browser : IE 6
    Problem : In my forms i m displaying images from blob column but some of the images are not displayed. I have tried with all image formats available in combination with all available display quality but no luck. What could be the reason for it and how do i solve it?
    Can anyone help me plz?
    Thnx in advance.
    Imtiaz

    Hello,
    It is very difficult for us to "guess" what images you can read and what others you cannot.
    Maybe you could provide more information on images that are not displayed ?
    What is their native format ?
    Francois

  • Problem Displaying images

    Hi I am trying to make a mud and the one thing I wanted to make different was an actual image map. My code reads the map from a text file and then places it into an array which then is displayed using diffent images for different characters. I wanted to start out by reading in the map and displaying it. So far so good considering that the code works while running in the applet viewer in PCGrasp, but the problem comes in when the html is run. Is there anything that I need to add to the code to display the map. The textbox and the background display but nothing else. Maybe my background is being placed on top of my images? Well here is the code so far:
    import java.applet.*;
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    public class ImageEx extends Applet implements Runnable
    // Initialisierung der Variablen
    int x_pos = 30;               // x - Position des Balles
    int y_pos = 100;          // y - Position des Balles
    int x_speed = 1;          // Geschwindigkeit des Balles in x - Richtung
    int radius = 20;          // Radius des Balles
    int appletsize_x = 300; // Gr��e des Applets in x - Richtung
    int appletsize_y = 300;     // Gr��e des Applets in y - Richtung
    // Variablen f�r die Doppelpufferung
    private Image dbImage;
    private Graphics dbg;
    private TextField commandLine;
    // Bildvariable f�r den Hintergrund
    Image Character;
    Image backImage;
    char array[][];
    MediaTracker mt;
    URL base;
    public void init()
    mt = new MediaTracker(this);
    setBackground(Color.blue);
    // Laden der Bilddatei
    backImage = getImage(getDocumentBase(), "desert.gif");
    Character = getImage(getDocumentBase(), "Test_Char.gif");
    commandLine = new TextField(50);
    add(commandLine,"South");
    try
    base = getDocumentBase();
    TextReader textReader = new TextReader ("First Map.txt");
    String s = textReader.readLine();
    String t = textReader.readLine();
    int z = Integer.parseInt(s);
    int y = Integer.parseInt(t);
    int x = 0, d = 0, c = 0;
    String map[] = new String[z];
    for(int j = 0; j < z; j++)
    map[j] = textReader.readLine();
    ++x;
    array = new char[z][y];
    for(int a = 0; a < array.length; a++)
    for(int b = 0; b < array[0].length; b++)
    array[a] = map[d].charAt(c);
    if(c != 21)
    ++c;
    else
    c = 0;
    ++d;
    //System.out.print(array[0][3]);
    catch (Exception e)
    System.out.println(e.toString());
    mt.addImage(backImage,1);
    mt.addImage(Character,2);
    // now tell the mediaTracker to stop the applet execution
    // (in this example don't paint) until the images are fully loaded.
    // must be in a try catch block.
    try
    mt.waitForAll();
    catch (InterruptedException e)
    public void start ()
    // Schaffen eines neuen Threads, in dem das Spiel l�uft
    Thread th = new Thread(this);
    // Starten des Threads
    th.start();
    public void stop()
    public void run ()
    // Erniedrigen der ThreadPriority um zeichnen zu erleichtern
    Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    // Solange true ist l�uft der Thread weiter
    while(true)
    // Wenn der Ball den rechten Rand ber�hrt, dann prallt er ab
    if(x_pos > appletsize_x - radius)
    // �ndern der Richtung des Balles
    x_speed = -1;
    // Ball br�hrt linken Rand und prallt ab
    else if(x_pos < radius)
    // �ndern der Richtung des Balles
    x_speed = +1;
    // Ver�ndern der x- Koordinate
    x_pos += x_speed;
    // Neuzeichnen des Applets
    repaint();
    try
    // Stoppen des Threads f�r in Klammern angegebene Millisekunden
    Thread.sleep (20);
    catch(InterruptedException ex)
    // do nothing
    // Zur�cksetzen der ThreadPriority auf Maximalwert
    Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
    /** Update - Methode, Realisierung der Doppelpufferung zur Reduzierung des Bildschirmflackerns */
    public void update(Graphics g)
    // Initialisierung des DoubleBuffers
    if(dbImage == null)
    dbImage = createImage(this.getSize().width, this.getSize().height);
    dbg = dbImage.getGraphics();
    // Bildschirm im Hintergrund l�schen
    dbg.setColor(getBackground ());
    dbg.fillRect(0, 0, this.getSize().width, this.getSize().height);
    // Auf gel�schten Hintergrund Vordergrund zeichnen
    dbg.setColor(getForeground());
    paint(dbg);
    // Nun fertig gezeichnetes Bild Offscreen auf dem richtigen Bildschirm anzeigen
    g.drawImage(dbImage, 0, 0, this);
    public void paint (Graphics g)
    mapDraw(g);
    g.setColor (Color.red);
    g.fillOval (x_pos - radius, y_pos - radius, 2 * radius, 2 * radius);
    public void mapDraw(Graphics c)
    int x_loc = 0;
    int y_loc = 0;
    for(int x = 0; x < array.length; x++)
    for(int y = 0; y < array[0].length; y++)
    switch(array[x][y])
    case 'x': backImage = getImage(getDocumentBase(), "grass_dark.gif");
    break;
    case 'E': backImage = getImage(getDocumentBase(), "dungeon_door.jpg");
    break;
    case '#': backImage = getImage(getDocumentBase(), "desert.gif");
    break;
    case 'H': backImage = getImage(getDocumentBase(),"house.gif");
    break;
    case 'U': backImage = getImage(getDocumentBase(),"house.gif");
    break;
    c.drawImage(backImage, x_loc, y_loc,16,16, this);
    x_loc += 16;
    y_loc += 16;
    x_loc = 0;
    c.drawImage(Character,64, 32,16,16, this);
    any help or constructive criticism would be greatly appreciated

    sorry for not having the code tags I had to copy and paste and the tags didn't copy over! :-(

  • Problem displaying image in jpanel

    Hi,I have posted this on the applet board, but I think its also a general programming problem, so apologies if it isn't relevant to this board, just say so and I'll remove it!
    I've got an applet that receives a variable from a PHP page as a parameter. The variable is "map1.png" the map this variable refers to sits in the same folder as the applet.
    I want to use this variable along with getDocumentBase() to create a URL which will then be used to display an image within a jPanel called mapPane.
    the code I currently have is:
    // get image url
    String mapURL = getParameter("mapURL");
    //set variable for image
    Image map_png;
    // set media tracker
    MediaTracker mt;
    //initialise media tracker     
    mt = new MediaTracker(this);
    map_png = getImage(getDocumentBase(),mapURL);
    // tell the MediaTracker to kep an eye on this image, and give it ID 1;
    mt.addImage(map_png,1);
    // now tell the mediaTracker to stop the applet execution
    // until the images are fully loaded.
    try
    mt.waitForAll();
    catch (InterruptedException e) {}
    // draw image onto mapPane
    mapPane.getGraphics().drawImage(map_png, 200, 200, null);
    Currently the Parameter is being passed into the applet (i've written it out within the applet) but the image is not being displayed. Does anyone have any suggestions about what I'm doing wrong?
    Cheers
    Steve

    hi,
    No, don't get any exceptions, the Java Console has a message:
    <terminated>JavaImageEditor[Java Applet]C:\Program Files\Java\jre1.6.0\bin\javaw.exe
    Cheers
    Steve

  • Problems displaying image in JPanel

    Hi, I've got an applet that receives a variable from a PHP page as a parameter. The variable is "map1.png" the map this variable refers to sits in the same folder as the applet.
    I want to use this variable along with getDocumentBase() to create a URL which will then be used to display an image within a jPanel called mapPane.
    the code I currently have is:
    // get image url
            String mapURL = getParameter("mapURL");
            //set variable for image
            Image map_png;
            // set media tracker
            MediaTracker mt;
            //initialise media tracker             
            mt = new MediaTracker(this);
            map_png = getImage(getDocumentBase(),mapURL);
            // tell the MediaTracker to kep an eye on this image, and give it ID 1;
            mt.addImage(map_png,1);
            // now tell the mediaTracker to stop the applet execution
            //  until the images are fully loaded.
            try
                 mt.waitForAll();
            catch (InterruptedException  e) {}
            // draw image onto mapPane
            mapPane.getGraphics().drawImage(map_png, 200, 200, null);Currently the Parameter is being passed into the applet (i've written it out within the applet) but the image is not being displayed. Does anyone have any suggestions about what I'm doing wrong?
    Cheers
    Steve

    Hello,
    after an update of the graphics card driver to the newest just released version the problem has vanished.
    Regards

  • VM problem displaying image?

    hi all,
    i have this code here
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class BackgroundSample {
    public static void main(String args[]) {
    JFrame frame = new JFrame("Background Example");
    final ImageIcon imageIcon = new ImageIcon("logo.gif");
    JTextArea textArea = new JTextArea() {
    Image image = imageIcon.getImage();
    Image grayImage = GrayFilter.createDisabledImage(image);
    {setOpaque(false);} // instance initializer
    public void paintComponent (Graphics g) {
    g.drawImage(grayImage, 0, 0, this);
    super.paintComponent(g);
    JScrollPane scrollPane = new JScrollPane(textArea);
    Container content = frame.getContentPane();
    content.add(scrollPane, BorderLayout.CENTER);
    frame.setDefaultCloseOperation(3);
    frame.setSize(600, 600);
    frame.setVisible(true);
    it supose to show a background image called logo.
    but when i run i dont see the image. any ideas why? or maybe can someone just check if it works plz
    thanks

    The main reason why it isn't working is quite simple...
    When you override paintComponent you need to do it inside a class that
    extends a JComponent, such as JTextArea or JFrame.
    Your class (BackgroundSimple) does not extend a JComponent
    so your paintComponent method will never be called
    You need to extends the JTextArea or JFrame and then put your paintComponent method there.
    Another possible problem with your method is that
    super.paintComponent(g) might clear the screen (I'm not
    really sure) so just to test if the image appears you
    could move things aroung like this...
         public void paintComponent (Graphics g) {
              super.paintComponent(g);
              g.drawImage(grayImage, 0, 0, this);
         }

  • Persistent Problems displaying images

    I thought I'd already managed to fix this problem but it doesn't seem to be the case. I have two tilelists that items can be dragged between and when each item is clicked the information and"largeImage" contained within it should display in the right hand panel however this works fine in previewing but when I actually change it into an air application and run it the images do not display in the right hand panel when each item within the tilelists is clicked.
    What changes would I need to make to this code to make it work correctly when changed into an AIR app?
    <?xml version="1.0" encoding="utf-8"?><mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initprofile1NewsAndSportSO()">
    <mx:Script>
    <![CDATA[
    Bindable][
    Embed(source="assets/images/bbcnews_small.png")] 
    public var image1:Class; 
    Bindable][
    Embed(source="assets/images/itv_small.png")] 
    public var image2:Class; 
    Bindable][
    Embed(source="assets/images/skynews_small.png")] 
    public var image3:Class; 
    ]]>
    </mx:Script>
    <mx:Script>
    <![CDATA[
    import mx.collections.*; 
    import flash.net.SharedObject; 
    public var profile1NewsAndSportSO:SharedObject; 
    private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new ArrayCollection([{link:
    "www.bbcnews.com", label:"BBC News", icon:"image1", largeImage:"assets/images/bbcnews_small.png", title:"BBC News", description:"BBC News description will go here"},{link:
    "www.itv.com/", label:"ITV", icon:"image2", largeImage:"assets/images/itv_small.png", title:"ITV", description:"ITV Description will go here"},{link:
    "www.skynews.com", label:"Sky News", icon:"image3", largeImage:"assets/images/skynews_small.png", title:"Sky News", description:"Sky News Description will go here"}]);
    private var profile1NewsAndSportaddLinksAC:ArrayCollection = new ArrayCollection([{link:
    "www.bbcnews.com", label:"BBC News", icon:"image1", largeImage:"assets/images/bbcnews_small.png", title:"BBC News", description:"BBC News description will go here"},{link:
    "www.itv.com/", label:"ITV", icon:"image2", largeImage:"assets/images/itv_small.png", title:"ITV", description:"ITV Description will go here"},{link:
    "www.skynews.com", label:"Sky News", icon:"image3", largeImage:"assets/images/skynews_small.png", title:"Sky News", description:"Sky News Description will go here"}]);
    private function profile1NewsAndSportReset():void{resetprofile1NewsAndSportAC();
    profile1NewsAndSportAddLinksTilelist.dataProvider
    = profile1NewsAndSportaddLinksAC;
    profile1NewsAndSportLinkChoice.dataProvider =
    new ArrayCollection([]);}
    private function resetprofile1NewsAndSportAC():void{profile1NewsAndSportaddLinksAC.removeAll();
    for each(var obj:Object in profile1NewsAndSportaddLinksFullAC){profile1NewsAndSportaddLinksAC.addItem(obj);
    private function initprofile1NewsAndSportSO():void{profile1NewsAndSportSO = SharedObject.getLocal(
    "profile1NewsAndSport"); 
    if(profile1NewsAndSportSO.size > 0){ 
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList){ 
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList != "empty"){ 
    var profile1NewsAndSportaddList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split(","); 
    var profile1NewsAndSporttempAC1:ArrayCollection = new ArrayCollection(); 
    for each(var str:String in profile1NewsAndSportaddList){ 
    for each(var obj1:Object in profile1NewsAndSportaddLinksAC){ 
    if(str == obj1.label){profile1NewsAndSporttempAC1.addItem(obj1);
    continue;}
    if(profile1NewsAndSporttempAC1.length > 0){profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;
    if(profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){ 
    var profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(","); 
    var profile1NewsAndSporttempAC2:ArrayCollection = new ArrayCollection(); 
    for each(var str2:String in profile1NewsAndSportchoiceList){ 
    for each(var obj2:Object in profile1NewsAndSportaddLinksAC){ 
    if(str2 == obj2.label){profile1NewsAndSporttempAC2.addItem(obj2);
    continue;}
    if(profile1NewsAndSporttempAC2.length > 0){profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;
    else{profile1NewsAndSportReset();
    private function saveprofile1NewsAndSport(event:MouseEvent):void{ 
    var profile1NewsAndSportaddList:String = ""; 
    if(profile1NewsAndSportAddLinksTilelist.dataProvider){ 
    if(ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){ 
    for each(var obj1:Object inprofile1NewsAndSportAddLinksTilelist.dataProvider){
    profile1NewsAndSportaddList += obj1.label +
    else{profile1NewsAndSportaddList =
    "empty";}
    profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;
    var profile1NewsAndSportchoiceList:String = ""; 
    for each(var obj2:Object inprofile1NewsAndSportLinkChoice.dataProvider){
    profile1NewsAndSportchoiceList += obj2.label +
    profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;
    profile1NewsAndSportSO.flush();
    ]]>
    </mx:Script>
    <mx:TileList id="profile1NewsAndSportAddLinksTilelist" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="292" width="650" left="21" columnCount="5" rowHeight="145" columnWidth="125" itemClick="titleLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.title; websiteLinkLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.link; descLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.description; linkImage.source=profile1NewsAndSportAddLinksTilelist.selectedItem.largeImage;" itemDoubleClick="{navigateToURL(new URLRequest('http://' + profile1NewsAndSportAddLinksTilelist.selectedItem.link))}" doubleClickEnabled="true" backgroundColor="#000000" borderColor="#FFFFFF" color="#FFFFFF" borderSides="top right left" y="25"/> 
    <mx:Canvas id="SitePreviewArea" y="10" width="453" height="540" backgroundColor="#545050" cornerRadius="20" borderStyle="solid" x="692" borderThickness="2" dropShadowEnabled="true" borderColor="#000000">
    <mx:Label x="45" y="309" text="Website Name:" width="150" height="52" fontSize="14" fontWeight="bold" color="#FFFFFF" left="10"/>  
    <mx:Label x="150.5" y="309" id="titleLabel" width="282.5" height="24" fontWeight="bold" fontSize="14" color="#FCFF00"/>
    <mx:Label x="124.5" y="385" text="Website Description:" width="200" height="24" fontSize="14" fontWeight="bold" color="#FFFFFF" textAlign="center"/>  
    <mx:TextArea x="16" y="417" id="descLabel" width="421" height="69" textAlign="left" color="#FCFF00" borderThickness="0" backgroundColor="#545050" editable="false" enabled="true" disabledColor="#FFFFFF" backgroundDisabledColor="#545050" fontWeight="bold" fontSize="12"/>
    <mx:Label x="61" y="342" text="Website Link:" width="150" height="52" fontSize="14" fontWeight="bold" color="#FFFFFF" left="10"/>
    <mx:TextArea x="150.5" y="343" id="websiteLinkLabel" width="282.5" height="33" fontWeight="bold" fontSize="12" color="#FCFF00" borderThickness="0" backgroundColor="#545050" editable="false" enabled="true" disabledColor="#FCFF00" backgroundDisabledColor="#545050"/>
    <mx:Button id="goToSiteButton" top="494" left="168" label="VISIT SITE" fontWeight="bold" fontSize="14" color="#000000" click="{navigateToURL(new URLRequest('http://' + websiteLinkLabel.text))}" fillAlphas="[1.0, 1.0]" fillColors="[#FFFFFF, #DCDCDC]" borderColor="#000000"/>
    <mx:Canvas x="99.5" y="51" width="250" height="250" backgroundColor="#FFFFFF">
    <mx:Image id="linkImage" click="{navigateToURL(new URLRequest('http://' + websiteLinkLabel.text))}" width="250" height="250" x="0" y="0" scaleContent="true" top="2" right="2" left="2" bottom="2"/>
     

    No thats not what I meant sorry. I have two versions with the same code. One a regular Flex app and one an AIR version but the code is of course exactly the same except for the WindowedApplication part. I only posted the flex app version code incase someone could take a look at it and modify it for me. It's just that the application needs to use the shared object method like in that code but it also needs to display the relevant image on the right hand panel when the app is installed on a user's machine.
    Here's the code for the AIR version:-
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initprofile1NewsAndSportSO()" viewSourceURL="srcview/index.html">
    <mx:Script>
    <![CDATA[
    Bindable][
    Embed(source="assets/images/bbcnews_small.png")] 
    public var image1:Class; 
    Bindable][
    Embed(source="assets/images/itv_small.png")] 
    public var image2:Class; 
    Bindable][
    Embed(source="assets/images/skynews_small.png")] 
    public var image3:Class; 
    ]]>
    </mx:Script>
    <mx:Script>
    <![CDATA[
    import mx.collections.*; 
    import flash.net.SharedObject; 
    public var profile1NewsAndSportSO:SharedObject; 
    private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new ArrayCollection([{link:
    "www.bbcnews.com", label:"BBC News", icon:"image1", largeImage:"assets/images/bbcnews_small.png", title:"BBC News", description:"BBC News description will go here"},{link:
    "www.itv.com/", label:"ITV", icon:"image2", largeImage:"assets/images/itv_small.png", title:"ITV", description:"ITV Description will go here"},{link:
    "www.skynews.com", label:"Sky News", icon:"image3", largeImage:"assets/images/skynews_small.png", title:"Sky News", description:"Sky News Description will go here"}]);
    private var profile1NewsAndSportaddLinksAC:ArrayCollection = new ArrayCollection([{link:
    "www.bbcnews.com", label:"BBC News", icon:"image1", largeImage:"assets/images/bbcnews_small.png", title:"BBC News", description:"BBC News description will go here"},{link:
    "www.itv.com/", label:"ITV", icon:"image2", largeImage:"assets/images/itv_small.png", title:"ITV", description:"ITV Description will go here"},{link:
    "www.skynews.com", label:"Sky News", icon:"image3", largeImage:"assets/images/skynews_small.png", title:"Sky News", description:"Sky News Description will go here"}]);
    private function profile1NewsAndSportReset():void{resetprofile1NewsAndSportAC();
    profile1NewsAndSportAddLinksTilelist.dataProvider
    = profile1NewsAndSportaddLinksAC;
    profile1NewsAndSportLinkChoice.dataProvider =
    new ArrayCollection([]);}
    private function resetprofile1NewsAndSportAC():void{profile1NewsAndSportaddLinksAC.removeAll();
    for each(var obj:Object in profile1NewsAndSportaddLinksFullAC){profile1NewsAndSportaddLinksAC.addItem(obj);
    private function initprofile1NewsAndSportSO():void{profile1NewsAndSportSO = SharedObject.getLocal(
    "profile1NewsAndSport"); 
    if(profile1NewsAndSportSO.size > 0){ 
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList){ 
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList != "empty"){ 
    var profile1NewsAndSportaddList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split(","); 
    var profile1NewsAndSporttempAC1:ArrayCollection = new ArrayCollection(); 
    for each(var str:String in profile1NewsAndSportaddList){ 
    for each(var obj1:Object in profile1NewsAndSportaddLinksAC){ 
    if(str == obj1.label){profile1NewsAndSporttempAC1.addItem(obj1);
    continue;}
    if(profile1NewsAndSporttempAC1.length > 0){profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;
    if(profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){ 
    var profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(","); 
    var profile1NewsAndSporttempAC2:ArrayCollection = new ArrayCollection(); 
    for each(var str2:String in profile1NewsAndSportchoiceList){ 
    for each(var obj2:Object in profile1NewsAndSportaddLinksAC){ 
    if(str2 == obj2.label){profile1NewsAndSporttempAC2.addItem(obj2);
    continue;}
    if(profile1NewsAndSporttempAC2.length > 0){profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;
    else{profile1NewsAndSportReset();
    private function saveprofile1NewsAndSport(event:MouseEvent):void{ 
    var profile1NewsAndSportaddList:String = ""; 
    if(profile1NewsAndSportAddLinksTilelist.dataProvider){ 
    if(ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){ 
    for each(var obj1:Object inprofile1NewsAndSportAddLinksTilelist.dataProvider){
    profile1NewsAndSportaddList += obj1.label +
    else{profile1NewsAndSportaddList =
    "empty";}
    profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;
    var profile1NewsAndSportchoiceList:String = ""; 
    for each(var obj2:Object inprofile1NewsAndSportLinkChoice.dataProvider){
    profile1NewsAndSportchoiceList += obj2.label +
    profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;
    profile1NewsAndSportSO.flush();
    ]]>
    </mx:Script>
    <mx:TileList id="profile1NewsAndSportAddLinksTilelist" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="292" width="650" left="21" columnCount="5" rowHeight="145" columnWidth="125" itemClick="titleLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.title; websiteLinkLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.link; descLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.description; linkImage.source=profile1NewsAndSportAddLinksTilelist.selectedItem.largeImage;" itemDoubleClick="{navigateToURL(new URLRequest('http://' + profile1NewsAndSportAddLinksTilelist.selectedItem.link))}" doubleClickEnabled="true" backgroundColor="#000000" borderColor="#FFFFFF" color="#FFFFFF" borderSides="top right left" y="25"/> 
    <mx:Canvas id="SitePreviewArea" y="10" width="453" height="540" backgroundColor="#545050" cornerRadius="20" borderStyle="solid" x="692" borderThickness="2" dropShadowEnabled="true" borderColor="#000000">
    <mx:Label x="45" y="309" text="Website Name:" width="150" height="52" fontSize="14" fontWeight="bold" color="#FFFFFF" left="10"/>  
    <mx:Label x="150.5" y="309" id="titleLabel" width="282.5" height="24" fontWeight="bold" fontSize="14" color="#FCFF00"/>
    <mx:Label x="124.5" y="385" text="Website Description:" width="200" height="24" fontSize="14" fontWeight="bold" color="#FFFFFF" textAlign="center"/>  
    <mx:TextArea x="16" y="417" id="descLabel" width="421" height="69" textAlign="left" color="#FCFF00" borderThickness="0" backgroundColor="#545050" editable="false" enabled="true" disabledColor="#FFFFFF" backgroundDisabledColor="#545050" fontWeight="bold" fontSize="12"/>
    <mx:Label x="61" y="342" text="Website Link:" width="150" height="52" fontSize="14" fontWeight="bold" color="#FFFFFF" left="10"/>
    <mx:TextArea x="150.5" y="343" id="websiteLinkLabel" width="282.5" height="33" fontWeight="bold" fontSize="12" color="#FCFF00" borderThickness="0" backgroundColor="#545050" editable="false" enabled="true" disabledColor="#FCFF00" backgroundDisabledColor="#545050"/>
    <mx:Button id="goToSiteButton" top="494" left="168" label="VISIT SITE" fontWeight="bold" fontSize="14" color="#000000" click="{navigateToURL(new URLRequest('http://' + websiteLinkLabel.text))}" fillAlphas="[1.0, 1.0]" fillColors="[#FFFFFF, #DCDCDC]" borderColor="#000000"/>
    <mx:Canvas x="99.5" y="51" width="250" height="250" backgroundColor="#FFFFFF">
    <mx:Image id="linkImage" click="{navigateToURL(new URLRequest('http://' + websiteLinkLabel.text))}" width="250" height="250" x="0" y="0" scaleContent="true" top="2" right="2" left="2" bottom="2"

  • Problems displaying images stored in SQL Server as Datatype "image"

    I am trying to display an Image stored in SQL Server as
    datatype
    'image' and it only shows a portion of the image.
    It seems to be tied to the size (kb) of the image since the
    larger the
    image the less of it is shown before it cuts off(sometimes it
    cuts off
    mid line so it's about the file size and not fitting the
    image on the
    screen).
    Here is the code I am using that deals with the image.
    [Bindable]
    public var theImage:ByteArray = new ByteArray;
    private function getScans_result(event:ResultEvent):void{
    var imageByteArray:ByteArray = event.result[0].Image;
    theImage = imageByteArray
    <mx:Image id="theIMG" width="160" height="220"
    source="{theImage}"/>
    Any Thoughts??

    I do that sort of thing using PHP and mySQL the binary part
    of the image is stored in a BLOB field (Binary Large OBject) along
    the rest of the information necessary for the http headers (e.g.
    mime type, file name, file size) being staored in their own fields.
    That info is then used to build the file using PHP. The PHP
    file contains a mySQL query whos result is echoed with the
    appropriate headers. The URL points at the PHP file rather than at
    any saved image.
    Here's the php:
    <?
    # display_imagebank_file.php
    # Note: the ID is passed through the url e.g.
    # this_files_name.php?id=1
    # connect to mysql database
    mysql_connect('HOST', 'USERNAME', 'PASSWORD');
    mysql_select_db('DATABASE');
    # run a query to get the file information
    $query = mysql_query("SELECT FileName, MimeType, FileSize,
    FileContents FROM blobTable WHERE ID='$id'");
    # perform an error check
    if(mysql_num_rows($query)==1){
    $fileName = mysql_result($query,0,0);
    $fileType = mysql_result($query,0,1);
    $fileSize = mysql_result($query,0,2);
    $fileContents = mysql_result($query,0,3);
    header("Content-type: $fileType");
    header("Content-length: $fileSize");
    header("Content-Disposition: inline; filename=$fileName");
    header("Content-Description: from imagebank");
    header("Connection: close");
    echo $fileContents;
    }else{
    $numRows = mysql_num_rows($query);
    echo "File not found <br>";
    echo $numRows;
    echo " is the number of rows returned for id = ";
    echo $ID;
    ?>
    Hope that helps
    Phil

  • Problems displaying images on sites

    i am using an addon that allows me to drag and drop links and open them in different tabs. whenever i try to drag and drop a image file from my facebook the tab will open but nothing is displayed. i know the page has loaded because i can see the cursor change as i hover over links but i can't see anything. when i minimize the window and restore it displays fine.

    You need to go to System Preferences > Displays > Arrangement > Mirror displays
    Voila

  • Problems display image from database

    I have set up an image upload page which allows the user to browse for a photograph and save the path of the photograph to the database.
    Unfortunately I can't figure out how to display the picture.
    I use an SQL $Get which retrieves the path correctly, but the image still does not display.
    I've tried 2 methods:
         imagejpeg($row_Get['PictureLocation'])
         This returns an error ...... imagejpeg() expects parameter  1 to be a resource.
    2nd method.
         Insert image then datasources.
         This doesn't do anaything in the browser, but curiosly displays a question marked box in live view.
    Any suggestions?

    I wrote an article about this recently. It's in the Dreamweaver Cookbook: http://cookbooks.adobe.com/post_Display_an_image_stored_in_a_database__PHP_-16637.html.

  • Problems displaying image in image item

    Hi,
    I have some tiff images on filesystem. which i sucessfully loaded into the database and are stored in blob column, thru SQL*Plus. when i tried to view these images in image item on my form, some of them doesn't show up. i checked the the length of the blob column, to see whether the image is actually loaded into the database and i found that the length is greater zero(infact very high). then i tried to load the image, which doesn't show up, from forms by read_image_file, neither it loads the image nor it displays an error.
    iam using oracle8i database and forms6.0.
    any help is greatly appreciated.
    regards,
    Krupal.

    thanx feng,
    i have tried to load the images thru forms into the database by using read_image_file. but some of the images are not showing up in the image item. i seriously doubt there is something wrong with the image file itself. the image files are in tiff format but saved with an extension .000 file for some reasons. now i doubt that all that images are not tiff files, some of them may be of some other type. bcos when i tried to save one of them as a tiff file it took more space than what it was earlier. after saving as tiff file the form loads the image successfully. is there anyway way that i can load the image in whatever form it is? or is there any way to convert automatically these images to tiff format?

  • Problems displaying images

    The following class is not displaying an image. Can anyone tell me why? Or, alternatively, does anyone have a complete class that works?
    Thank you.
    (ImageFile, obviously, is a parameter passed from an HTML Applet tag)
    import java.awt.Graphics;
    import java.awt.Image;
    public class ShowImage extends java.applet.Applet {
    private Image imageArt;
    public void init() {
    imageArt = getImage(getCodeBase(), getParameter("ImageFile"));
    public void paint(Graphics g) {
    g.drawImage(imageArt, 0, 0, this);
    }

    Nothing wrong, works for me

  • Problem displaying images from the content manager

    I am displaying an html page from a <cm:select> but the images do not display.
    I have set up the dmsbase directory as per the samplePortal, and loaded the content.
    The HTML displays, but with errors for the images.
    Here's the select from the portlet:
    <cm:select contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>"
    query="type='page'"
    id="textDocs"/>
    <es:forEachInArray array="<%=textDocs%>" id="aTextDoc" type="com.bea.p13n.content.Content">
    <p><cm:printDoc id="aTextDoc" failOnError="true" /></p>
    </es:forEachInArray>

    OK, I found Greg's reply and that fixed it, once I played with it a bit.
    "Cory McGinnis" <[email protected]> wrote:
    >
    I am displaying an html page from a <cm:select> but the images do not
    display.
    I have set up the dmsbase directory as per the samplePortal, and loaded
    the content.
    The HTML displays, but with errors for the images.
    Here's the select from the portlet:
    <cm:select contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>"
    query="type='page'"
    id="textDocs"/>
    <es:forEachInArray array="<%=textDocs%>" id="aTextDoc" type="com.bea.p13n.content.Content">
    <p><cm:printDoc id="aTextDoc" failOnError="true" /></p>
    </es:forEachInArray>

  • Problem displaying image

    My serlvet (hosted on www.mycgiserver.com) is supposed to output an html page that includes images but the images won't display. Any ideas?

    i think you should check your images path, is it correct ?

  • Problems displaying images on tv using dvi-vga cables

    I connected my macbook to a Samsung hdtv via dvi-vga cables. The picture looked great on the tv, however it only displays my background. The tv does not display any open windows, desktop folders, or even the application dock at the bottom of the computer screen. Any ideas on what I may be doing wrong??

    You need to go to System Preferences > Displays > Arrangement > Mirror displays
    Voila

Maybe you are looking for

  • Copying page from one page group to another

    I need to copy one page or multiple from one page group DEV to page group TEST. I thought of using Portal Export/Import feature for the same, but it will ask for same page group at import. Requirement is to keep one set of page group for DEV stage, w

  • How to mirror and setup independantly

    I want to use the two displays in the following ways. 1. Use the display with macbook in clamshell mode, then when open mb to have the mb mirror the display with both displays at their native res. Currently res gets messed up and can't see whole scre

  • ATI card + OS driver + multi monitor

    Hello everyone, I'm stuck configuring the RadeonHD drivers for multi monitor setup. The system starts with both screens cloned; logging in is in clone mode too. After that the second display is being turned of (no signal). Using xrandr --auto will en

  • Index is not using for this query

    I have this query and it doesn't use index. Can you put your suggestion please? SELECT /*+ ORDERED USE_HASH(IC_GSMRELATION) USE_HASH(IC_UTRANCELL) USE_HASH(IC_SECTOR) USE_HASH(bt) */ /* cp */ bt.value value, bt.tstamp tstamp, ic_GsmRelation.instance_

  • Metadata and Reflection

    Hi all, the great dream for any java programmer is a kind of runtime support for mapping relations to objects. Now is possible! The Oracle iWorkplace applications comes with java sources that demonstrate how is possible, using JDBC database metadata