Loading an image to JFrame

First of all hello to everyone. I'm sorry I'm asking a trivial question. I'd like to know how to load an image to Java application from one of my hard drive folders(e.g. My Pictures). I've searched on the internet, found some tips but it doesn't work. I'm using Eclipse. Below is the code
package GUI;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import java.awt.FlowLayout;
public class firstgui extends JFrame {
     private JLabel label1;
     public firstgui() {
     super("GUI");
     Icon plane=new ImageIcon("My Pictures/F-16");
     label1=new JLabel("This is my first GUI",plane,SwingConstants.CENTER);
     add(label1);
}AND THIS IS THE CODE FOR TESTING THE PROGRAM:
package GUI;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.SwingConstants;
import java.awt.FlowLayout;
import javax.swing.JLabel;
public class firstguiexecution {
public static void main(String args[]){
     firstgui mygui=new firstgui();
     warplanes.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
     warplanes.setSize(275,180);
     warplanes.setVisible(true);
}Thanks in advance.
Edited by: shc89 on Apr 28, 2009 11:45 AM

Thanks for the help guys. I've tried most of the things you said but still doesn't work. I even tried to just copy and paste an example program from the book but it still doesn't work, I get the same errors as with my program
This is the code of the example program:
package bookExample;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import java.awt.FlowLayout;
public class example extends JFrame {
          private JLabel label1;
          public example()
               super("Testing JLabel");
               setLayout(new FlowLayout());
               label1=new JLabel("Label with text");
               Icon bug = new ImageIcon(getClass().getResource("h2.jpeg"));
          label1=new JLabel("Label",bug,SwingConstants.LEFT);
          label1.setToolTipText("This is label1");
          add(label1);
}and execution class:
package bookExample;
import javax.swing.JFrame;
public class test {
public static void main(String args[]){
     example testexample = new example();
     testexample.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     testexample.setSize(275,180);
     testexample.setVisible(true);
}These are the errors I get:
Exception in thread "main" java.lang.NullPointerException
     at javax.swing.ImageIcon.<init>(Unknown Source)
     at bookExample.example.<init>(example.java:19)
     at bookExample.test.main(test.java:6)
Apparently, there's an error in getClass().GetResource line and in the execution part, in the line where the object is being created.

Similar Messages

  • (newbie) - Loading an image in JFrame

    Hi All,
    I have a problem with loading an image on JPanel. Can somebody explain the procedure? Should I use a canvas or something?
    Thanks,
    Deepak

    kanad wrote:
    Try this
    ImageIcon icon = new ImageIcon("backUp.gif");
    JPanel panel = new JPanel()
    protected void paintComponent(Graphics g)
    g.drawImage(img.getImage(), 0, 0, null);
    super.paintComponent(g);
    If you're going to go the "custom JPanel" route as above, don't create an ImageIcon just for its Image. Instead grab a BufferedImage from javax.imageio.ImageIO and draw that directly in your paintComponent() override.

  • Problem with display an image on JFrame in Java 6

    I'm trying to display an image on JFrame in this way:
    1.) I'm creating a variable in the class:
        private Image imgSpeaker = null;2.) I'm overiting the paint method:
    public void paint(Graphics g) {
            super.paint(g);   
            g.drawImage(imgSpeaker, 330, 230, null);  
        }3.) In the constructor I'm using this code:
       imgSpeaker = Toolkit.getDefaultToolkit().getImage("D:\\speaker.gif");
            MediaTracker trop = new MediaTracker(this);
            trop.addImage(imgSpeaker,0);
            try {
                trop.waitForID(0);    // waiting untill downloading progress will be complite
            } catch (Exception e) {
                System.err.println(e);
            }        The Image will be displayed on form, but if I catch the window and move it (for example: down as possible)
    the image is not refreshed (repainted). What I'm doing wrong? I've been used this solution in Java 5 and everything
    works perfectly. Any of described methods aren't depricated... Anyone can help me?

    Thanks for your code, I've been tryed to apply your solution (with create a Buffered Image), but it still not working correctly. Firstly, the image isn't loading, and secondly the basic problem is not give in. Why have you been using "bg2d.draw(img, x, y, w, h, frame);" not in the paint method?
    I'm use "Free Design" layout. Below I put on completly code from Netbeans.
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.MediaTracker;
    import java.awt.image.BufferedImage;
    public class ImageTest extends javax.swing.JFrame {
        private Image imgSpeaker = null;
        private BufferedImage bi = null;
        private MediaTracker trop = null;
        public ImageTest() { 
                initComponents();
                trop = new java.awt.MediaTracker(this);
                imgSpeaker = java.awt.Toolkit.getDefaultToolkit().getImage("D:\\speaker.gif");
                try {
                    trop.addImage(imgSpeaker, 0);
                    trop.waitForID(0);
                } catch (java.lang.Exception e) {
                    java.lang.System.err.println(e);
                bi = new java.awt.image.BufferedImage(100, 100, java.awt.image.BufferedImage.TYPE_INT_RGB);
                java.awt.Graphics2D bg2d = (java.awt.Graphics2D) bi.createGraphics();
                trop.addImage(bi, 1);
    //            java.io.File f = new java.io.File("D:\\speaker.gif");
    //            try {
    //                bi = javax.imageio.ImageIO.read(f);
    //            } catch (IOException e) {
    //               java.lang.System.err.println(e);
        public void paint(Graphics g) {
    //      super.paint(g);
           try {                                                   
                trop.waitForAll();                                 
            } catch (Exception e) {
                System.err.println(e);
            g.drawImage(bi, 50, 100, imgSpeaker.getHeight(this), imgSpeaker.getHeight(this), this);
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("jButton1");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(283, Short.MAX_VALUE)
                    .addComponent(jButton1)
                    .addGap(44, 44, 44))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(252, Short.MAX_VALUE)
                    .addComponent(jButton1)
                    .addGap(25, 25, 25))
            pack();
        }// </editor-fold>
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ImageTest().setVisible(true);
        private javax.swing.JButton jButton1;
    }

  • Loading an image into an Applet from a JAR file

    Hello everyone, hopefully a simple question for someone to help me with!
    Im trying to load some images into an applet, currently it uses the JApplet.getImage(url) method just before registering with a media tracker, which works but for the sake of efficiency I would prefer the images all to be contained in the jar file as oppossed to being loaded individually from the server.
    Say I have a class in a package eg, 'com.mydomain.myapplet.class.bin' and an images contained in the file structure 'com.mydomain.myapplet.images.img.gif' how do I load it (and waiting for it to be loaded before preceeding?
    I've seen lots of info of the web for this but much of it is very old (pre 2000) and im sure things have changed a little since then.
    Thanks for any help!

    I don't touch applets, so I can't help you there, but here's some Friday Fun: tracking image loading.
    import java.awt.*;
    import java.awt.image.*;
    import java.beans.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.imageio.event.*;
    import javax.imageio.stream.*;
    import javax.swing.*;
    public class ImageLoader extends SwingWorker<BufferedImage, Void> {
        private URL url;
        private JLabel target;
        private IIOReadProgressAdapter listener = new IIOReadProgressAdapter() {
            @Override public void imageProgress(ImageReader source, float percentageDone) {
                setProgress((int)percentageDone);
            @Override public void imageComplete(ImageReader source) {
                setProgress(100);
        public ImageLoader(URL url, JLabel target) {
            this.url = url;
            this.target = target;
        @Override protected BufferedImage doInBackground() throws IOException {
            ImageInputStream input = ImageIO.createImageInputStream(url.openStream());
            try {
                ImageReader reader = ImageIO.getImageReaders(input).next();
                reader.addIIOReadProgressListener(listener);
                reader.setInput(input);
                return reader.read(0);
            } finally {
                input.close();
        @Override protected void done() {
            try {
                target.setIcon(new ImageIcon(get()));
            } catch(Exception e) {
                JOptionPane.showMessageDialog(null, e, "Error", JOptionPane.ERROR_MESSAGE);
        //demo
        public static void main(String[] args) throws IOException {
            final URL url = new URL("http://blogs.sun.com/jag/resource/JagHeadshot.jpg");
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    launch(url);
        static void launch(URL url) {
            JLabel imageLabel = new JLabel();
            final JProgressBar progress = new JProgressBar();
            progress.setBorderPainted(true);
            progress.setStringPainted(true);
            JScrollPane scroller = new JScrollPane(imageLabel);
            scroller.setPreferredSize(new Dimension(800,600));
            JPanel content = new JPanel(new BorderLayout());
            content.add(scroller, BorderLayout.CENTER);
            content.add(progress, BorderLayout.SOUTH);
            JFrame f = new JFrame("ImageLoader");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(content);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
            ImageLoader loader = new ImageLoader(url, imageLabel);
            loader.addPropertyChangeListener( new PropertyChangeListener() {
                 public  void propertyChange(PropertyChangeEvent evt) {
                     if ("progress".equals(evt.getPropertyName())) {
                         progress.setValue((Integer)evt.getNewValue());
                         System.out.println(evt.getNewValue());
                     } else if ("state".equals(evt.getPropertyName())) {
                         if (SwingWorker.StateValue.DONE == evt.getNewValue()) {
                             progress.setIndeterminate(true);
            loader.execute();
    abstract class IIOReadProgressAdapter implements IIOReadProgressListener {
        @Override public void imageComplete(ImageReader source) {}
        @Override public void imageProgress(ImageReader source, float percentageDone) {}
        @Override public void imageStarted(ImageReader source, int imageIndex) {}
        @Override public void readAborted(ImageReader source) {}
        @Override public void sequenceComplete(ImageReader source) {}
        @Override public void sequenceStarted(ImageReader source, int minIndex) {}
        @Override public void thumbnailComplete(ImageReader source) {}
        @Override public void thumbnailProgress(ImageReader source, float percentageDone) {}
        @Override public void thumbnailStarted(ImageReader source, int imageIndex, int thumbnailIndex) {}
    }

  • Loading an image from an arbitrary URL without using an ImageIcon

    Can anybody maybe point me in the direction of other (as in harder-to-use, but more flexible) ways to load an image from a URL?

    Interesting results:
    When I run this test code (the names have been changed to protect the innocent):
    package graphicstest;
    import javax.swing.*;
    import java.net.*;
    import javax.imageio.*;
    import java.awt.image.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2007</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Foo
        extends JFrame {
      static ImageIcon ii;
      public Foo() {
        setSize(200,200);
        try {
          System.out.println("2=aborted; 8=complete; 4=errored; 1=loading");
          ii = new ImageIcon(new URL("http://intranet/part?FOO.JPG"));
          System.out.println("image load status: " + ii.getImageLoadStatus());
          getContentPane().add(new JLabel(ii));
          System.out.println("image load status: " + ii.getImageLoadStatus());
        }catch(Throwable t) {t.printStackTrace();}
      public static void main(String args[]) {
          Foo foo = new Foo();
          foo.setVisible(true);
          if (ii.getImageLoadStatus() == 4) {
            try {
              BufferedImage bi = ImageIO.read(new URL(
                    "http://intranet/part?FOO.JPG"));
              ii.setImage(bi);
              foo.validate();
              foo.repaint();
            } catch(Throwable t) {t.printStackTrace();};
    }. . . from a box that's not on the VPN, it blows up at the ImageIO.read() call (not unexpectedly). But if I run it from a box that's on the VPN, and able to access the URL, then it returns just fine from the ImageIO.read(), and I get a null pointer exception at the call to setImage().
    Clearly, this is trying to tell me SOMETHING, but I don't quite know WHAT.
    JHHL

  • Inserting a background image on JFrame

    I am developing an interactive system for the london 2012 olympics (Not a real one, just a project :-)) I am starting by creating my GUI layout. This is where i have started.
    import java.awt.*;        
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.util.*;
    import java.awt.event.KeyListener;
    import java.io.*;
    import java.text.*;
    public class Assignment extends JFrame  
       private JLabel londOnJLabel;
    public Assignment()
              ImageIcon image = new ImageIcon("???.jpg");
              JLabel background = new JLabel(image);
              background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
              getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));
    private void createUserInterface()
              Container contentPane = getContentPane();
              contentPane.setLayout( null );
              londOnJLabel = new JLabel();
              londOnJLabel.setBounds( 19, 19, 875, 28 );
              londOnJLabel.setText( "LONDON 2012" );
              londOnJLabel.setFont(new Font( "Default", Font.BOLD, 36 ) );
              londOnJLabel.setHorizontalAlignment(JLabel.CENTER );
              contentPane.add( londOnJLabel );
              setTitle( "LONDON 2012" );
              setSize( 1000, 750 );         
              setVisible( true );         
    public static void main( String[] args )
          Assignment application = new Assignment();
          application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }So at the moment this Just displays LONDON 2012 on my application. Now what i would like to try and do is insert a background image of the olympic rings. How would i go about doing this?
    cheers

    THFC wrote:
    sorry, when u say dont subclass JFrame, are you referring to this?
    public Assignment() ....
    No I meant don't do this: public class Assignment extends JFrameBut rather do this: do this: public class Assignment extends JPanelFor example:
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class Assignment2 extends JPanel
      private static final String FILE_PATH = "myImageFile.jpg"; // !! change this
      private static final String NET_URL_PATH = "http://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Mooring_bollard_at_sunset%2C_Lyme_Regis.jpg/800px-Mooring_bollard_at_sunset%2C_Lyme_Regis.jpg";
      // Photo by Michael Maggs, Wikimedia Commons: http://commons.wikimedia.org/wiki/Image:Mooring_bollard_at_sunset%2C_Lyme_Regis.jpg
      private BufferedImage image = null;
      public Assignment2()
        try
          // first load the image
          //image = ImageIO.read(new File(FILE_PATH));
          image = ImageIO.read(new URL(NET_URL_PATH));
        catch (IOException e)
          e.printStackTrace();
        // then set up the JPanel.  Try to avoid using the "null" layout
        JLabel titleLabel = new JLabel("My Title Goes Here");
        titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD, 36));
        titleLabel.setForeground(Color.lightGray);
        JPanel titlePanel = new JPanel();
        titlePanel.setOpaque(false);
        titlePanel.add(titleLabel);
        setPreferredSize(new Dimension(800, 590));
        setLayout(new BorderLayout());
        add(titlePanel, BorderLayout.NORTH);
      @Override  // here's where I paint my background:
      protected void paintComponent(Graphics g)
        super.paintComponent(g);
        if (image != null)
          g.drawImage(image, 0, 0, this);
      private static void createAndShowUI()
        // Then I only create my JFrame when I need it.  I don't override it.
        // This way, I can use this same code in a JApplet, or a JDialog, or whatever
        JFrame frame = new JFrame("Assignment2");
        frame.getContentPane().add(new Assignment2()); // and add the JPanel to the JFrame here
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    }Edited by: Encephalopathic on May 26, 2008 4:11 PM

  • Error loading an image into an image icon

    Im having trouble with a gui that has to load external images, and ive isolated the loading to one spot. When I ask the Image icon for its status it always returns errored, but i dont know what error or how to fix it.
    Pulling My Hair Out
    JTuba
    import java.awt.*;
    import javax.swing.*;
    public class test
         public static void main(String[] args)
              JFrame.setDefaultLookAndFeelDecorated(true);
              JFrame frame = new JFrame("FrameDemo");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              Container c = frame.getContentPane();
              JPanel panel = new JPanel()
                   public void paintComponent(Graphics g)     
                        ImageIcon img = new ImageIcon("CA.jpg");
         System.out.println(String.valueOf(img.getImage()==null));
                        ///These bouth output 4\\\\\
                   System.out.println(img.getImageLoadStatus());
                   System.out.println(MediaTracker.ERRORED);
                        ///The iomage is NEVER drawn\\\
                   g.drawImage(img.getImage(), 0, 0, null);
                        super.paintComponent(g);
              panel.setOpaque(true);
              c.add(panel);
              //panel.validate();
              //panel.repaint();
              //panel.pack();
              frame.setSize(750,450);
              frame.setVisible(true);
    }

    Hello,
    you should paint the background(super.paintComponent) before all other:JPanel panel = new JPanel()
    Image img Toolkit.getDefaultToolkit().getImage(yourCorrectPath);
         public void paintComponent(Graphics g)
              super.paintComponent(g);
              g.drawImage(img, 0, 0, this);
    };regards,
    Tim

  • Loading background image

    Hey all i'm having a little difficulty loading an image as a background. This is the code currently used to create several panels and add to a main container:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Random;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.*;
    public class MainPanel extends JFrame implements ActionListener {
         private JMenuItem newGame, endGame, exitApplication; // File menu items
         private JRadioButtonMenuItem easyLevel, mediumLevel, hardLevel; // Level menu items
         DiePanel diePanel;
         QuestionPanel questionPanel;
         PicturePanel board;
         public MainPanel (){
              // Call & set up DiePanel
              diePanel = new DiePanel();
              diePanel.setBorder (BorderFactory.createEtchedBorder());
              diePanel.setPreferredSize(new Dimension(254,86));
              diePanel.setVisible(true);
              // Call & set up QuestionPanel
              questionPanel = new QuestionPanel();
              questionPanel.setBorder (BorderFactory.createEtchedBorder());
              questionPanel.setPreferredSize(new Dimension(304,86));
              questionPanel.setVisible(true);
              // Call & set up BoardPanel
              board = new PicturePanel(diePanel, questionPanel);
              board.setPreferredSize(new Dimension(622,622));
              board.setVisible(true);
              diePanel.setBoard(board);
              // Add panels to container
              Container c = getContentPane();
             c.setLayout (new FlowLayout());
             c.add(diePanel);
             c.add(Box.createHorizontalStrut(20));
             c.add(questionPanel);
             c.add(board);And i create the main JFrame with this:
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    public class Main {
         public static void main(String [] args) {
             SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                       JFrame MainPanel = new MainPanel();
                       MainPanel.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                       MainPanel.setSize(800, 800);
                       MainPanel.setVisible(true);
                       MainPanel.setTitle("Math's Mayhem");
    }I've tried numerous ways to try and load an image but to no avail! Do i need to use layered panes or is there a more simple way?

    Anand_EKM wrote:
    Also meanwhile you can visit the link [Setting Background Image on JFrame|http://javaallinone.blogspot.com/2008/03/setting-background-image-on-jframe.html]
    The code presented in the link above (probably) works, but should NOT be copied verbatim! It has several problems:
    1. That code loads and creates the image each time the JPanel's paintComponent() method is called, which is terribly inefficient. It should be modified so that the image is loaded once (when the JFrame or JPanel is first created) and cached. paintComponent() should then simply call g.drawImage().
    2. You should also create the Image via ImageIO.read() rather than new ImageIcon(...).getImage() as done in that example, to avoid unnecessarily creating an ImageIcon. It's not a huge deal, but your code will be cleaner and more readable.
    3. I'm not sure why this example wants to do things such as setting the preferred/minimum/maximum sizes and layout used in the paintComponent() body.
    Edited by: BoBear2681 on Apr 2, 2008 12:48 PM

  • Error While loading a image from database

    Purpose
    Error While loading the Image from the database
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Requirement:
    I am developing the web pages using PSP(Pl/sql Serverpages) . I have a requirement to show a image in the webpage. I got the following procedures from the oracle website.
    I have created the following table to store the images
    create table DEMO
    ID INTEGER not null,
    THEBLOB BLOB
    And I also uploaded the Images. Now I am try to get a image from the table using the following procedure .But I am getting the error message line 25( htp.prn( utl_raw.cast_to_varchar2( l_raw ) );) .at it throws the following error messages
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Procedure that I used to get the image
    create or replace package body image_get
    as
    procedure gif( p_id in demo.id%type )
    is
    l_lob blob;
    l_amt number default 30;
    l_off number default 1;
    l_raw raw(4096);
    begin
    select theBlob into l_lob
    from demo
    where id = p_id;
    -- make sure to change this for your type!
    owa_util.mime_header( 'image/gif' );
    begin
    loop
    dbms_lob.read( l_lob, l_amt, l_off, l_raw );
    -- it is vital to use htp.PRN to avoid
    -- spurious line feeds getting added to your
    -- document
    htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
    l_off := l_off+l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    end;
    What I have to do to correct this problem. This demo procedure and table that I am downloaded from oracle. Some where I made a mistake. any help??
    Thanks,
    Nats

    Hi Satish,
    I have set the raw value as 3600 but still its gives the same error only. When I debug the procedure its throwing the error stack in
    SYS.htp.prn procedure of the following line of code
    if (rows_in < pack_after) then
    while ((len - loc) >= HTBUF_LEN)
    loop
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1, HTBUF_LEN);
    loc := loc + HTBUF_LEN;
    end loop;
    if (loc < len)
    then
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1);
    end if;
    return;
    end if;
    Its a system procedure. I don't no how to proceed .. I am really stucked on this....is their any other method to take picture from the database and displayed in the web page.....???? any idea..../suggesstion??
    Thanks for your help!!!.

  • How do I run a simple script that loads an image into photoshop CS - CS4?

    Hello,
    I am at a loss on how to get my simple application to work. I have a small desktop air application that simply opens Photoshop and runs an action. I used switchboard and the application ran great on PC and MAC. However it only worked for CS3, and CS4 not CS or CS2?. Plus the size of switchboard was a bit large for my small app. I am willing to live with that though . I am using Air with Flex and wanted to know if perhaps there is a beter approach? All the application does is open photoshop, loads an image, and runs an action. Can I do this for all versions of Photoshop using switchboard? Can I do this without switchboard and just use javascript. The big issue is the Air app needs to open Photoshop, and most of the examples have me open PS first and then execute a script located in the PS directory. This needs to work outside of the PS directory. Any examples are appreciated.
    I have looked at the following:
    - SwitchBoard : only works for CS3-CS4 (on my tests)
    - PatchPanel: same issue, plus seperate SDKs
    - ExtendScript: requires script to be run from PS not Air

    Hello,
    I am at a loss on how to get my simple application to work. I have a small desktop air application that simply opens Photoshop and runs an action. I used switchboard and the application ran great on PC and MAC. However it only worked for CS3, and CS4 not CS or CS2?. Plus the size of switchboard was a bit large for my small app. I am willing to live with that though . I am using Air with Flex and wanted to know if perhaps there is a beter approach? All the application does is open photoshop, loads an image, and runs an action. Can I do this for all versions of Photoshop using switchboard? Can I do this without switchboard and just use javascript. The big issue is the Air app needs to open Photoshop, and most of the examples have me open PS first and then execute a script located in the PS directory. This needs to work outside of the PS directory. Any examples are appreciated.
    I have looked at the following:
    - SwitchBoard : only works for CS3-CS4 (on my tests)
    - PatchPanel: same issue, plus seperate SDKs
    - ExtendScript: requires script to be run from PS not Air

  • Using ImageIcon load an image

    Hi I'm having a lot of trouble getting the below code to work. Its copied out of my textbook and its supposed to load an image using the getImage method in the ImageIcon class. The strange thing is I have gotten this to work before, but after I installed Windows 2000 the image doesn't seem to load right anymore.
    getWidth and getHeight - on the image afterwards returns -1.
    Could this be windows 2000's problem? I'm pretty sure it isn't .. but when you run out of ideas, it feels good to put the blame on something other than yourself.
    import java.awt.*;
    import javax.swing.*;
    import java.net.*;
    public class DisplayImage extends JApplet
    public void init()
    ImageIcon icon = null;
    try
    icon = new ImageIcon(new URL(getCodeBase(), "Images/backTile.bmp"));
    catch(MalformedURLException e)
    System.out.println("Failed to create URL:\n"+e);
    return;
    int imageWidth = icon.getIconWidth();
    int imageHeight = icon.getIconHeight();
    resize(imageWidth, imageHeight);
    ImagePanel imagePanel = new ImagePanel(icon.getImage());
    getContentPane().add(imagePanel);
    class ImagePanel extends JPanel
    public ImagePanel(Image image)
    this.image = image;
    public void paint(Graphics g)
    g.drawImage(image,0,0,this);
    Image image;
    Again thx a lot. I know its a lot of code to read. Any help at all would be much appreciated.

    ".bmp" ? Windows bitmap isn't a supported file type, you should save your image as .gif, .png, or as .jpg.

  • Unable to Load the images Required by Classroom in a Book

    Just purchased Adobe Photoshop Elements 12.  I am trying the follow the lessons in the above book.  When I create the files and download the images, I am unable the import the files and images into the Photoshop Organizer.  Some images will import but most just display a weird icon.  I have reloaded, updated Windows, Photoshop, display drivers, you name it.  Nothing works.
    Using Windows 7 with 8 GBs of 64 bit memory.
    I like the book, and feel it will be a great introduction to Photoshop.  But if I can't load the images into the Photoshop 12 Organizer. I can't follow or use the book
    Lou (tobytussah)

    Lou again.
    As a follow up.  I am also unable to reliability load any Images into the Organizer either by using the Organizer File find functions or totally unable to move images into the Organizer using the Windows Explorer.
    Should the ask for help better belong in some other forum?
    Lolu

  • Unable to load TIF images into Photoshop.

    CS4 (11.0.2) and Windows 7 Home Edition.
    Have developed a problem trying to load some TIF images into Photoshop. I have a large number of images archived over a decade or more. At this point it may some of the older files that exhibit the problem. Now all these files were edited and stored using the Photoshop versions during the complete time period. The files are always saved with no compression. Have tried to load from Photoshop and clicking on the file in a file list. Photoshop just hangs and I get the message Program not responding. I can take these same files and load them into the ROXIO photo editor with no problem. Stranger yet is if I simply load the file into the ROXIO editor then "save as" back into the same folder (overwrite) the file can then be brought into Photoshop with no problem! Any ideas?

    Noel,
    Will try to keep short.
    I reinstalled Photoshop CS4 from the cd CS set. Did not uninstall first. Restarted PC and Photoshop. Still failed the same way with a 3001 image.
    Did the following, changing one item in the Edit->Preference->GPU Setting. After each change, closed Photoshop, reopened, brought in 3001 image, restored original setting. 3001 failed each time.
    * Unchecked Enable OpenGL Drawing
    * Advanced setup: Unchecked Advanced Drawing.
    * Advanced setup: Unchecked Color Matching
    Next went to the Edit->Color Profile.
    Scanned thru options and saw in the Convert Options: Engine. It was set to Adobe (ACE). ACE was the module name in the error detail!
    Only other option for this is Microsoft ICM. Changed to that, close/open Photoshop and 3001 came in no problem. So did the Nikon 3000, srgb IEC 61922 2.1 and Untagged. However, when briging in an Adobe RGB(1998) image Photoshop notes Profile Mismatch. It allows me to decide what to do (use embedded profile instead of workspace; convert color to work space color; discard embedded profile. and I choose use the convert color and it loads ok. At least it loads the image! Will use this approach for now. I need to get educated on color profiles!!
    Joe

  • Dynamic load of images in to established Timeline effect

    Is it possible to dynamicly load images in to an already
    established timeline effect?
    Steps I've done.
    Stuffed a JPG in to the library by draging and dropping it in
    to the SWFs library.
    Dropped the JPG on to the main stage
    Right clicked the image then going down to Timeline effects
    and choosing an effect.
    Completing any changes in effects dialogue box and then
    clicking OK.
    Play the movie, and pat myself on the back that it worked.
    So then, how can I get Actionscript to load an image
    dynamically in to that same Timeline effect and have it do the
    effect to that instead of the one found in the library?
    I'm using Flash MX Professional 2004.

    hii
    Can u mention the error message getting while the status become RED??
    As what I understand, this may be the issue of invalid characteristics inPSA Data Records or also there may be records that does not support the lower case or upper case data.
    So just check the data in PSA Level
    Thanks
    Neha

  • Inserting an image to Jframe and save it ,  in SQL database

    Hai guys,
    I just wanna know about the inserting image in to a Jframe (in netBeans) it will be a grate help if you tell me the way to call a image to Jframe through a Button click and save the image in MySQl database.
    Is anyone has a idea about this task, please tell me
    Thanks,

    Image class should work to get the data, then add it to a Canvas object, then you can save the bytes from the Image into an SQL statement through JDBC.
    The implementation details will vary based on which approch and database you select.

Maybe you are looking for

  • Apex 4.1 IR: $.datepicker._curInst' is null or not an object

    Funniest thing after upgrade from 4.0 to 4.1 - Getting page error on IR when trying to create filters: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .N

  • Email address in submit to button

    I'm asking a very direct and plain question and desire a direct and plain answer.  Don't tell me to just use the 'Button Tool', because it is nowhere to be found. 1.  I created an adobe fillable form from scratch using AA9 Pro/LiveCycle. 2.  I will d

  • Production Report required SHIFTWISE

    Hello Sirs, I have following requirement in SAP through ECC 6.0 1. Production Report Shiftwise REPORT. 2. While confirming Client wants to mention the name of the Operator who has done the Rejection (HR module not opted for). 3. Whether we can input

  • OC4J Instance included in Forms 10g R2 NOT Stable

    I am able to deploy a form for testing on WIndows 2003 Server. C:\Documents and Settings\Administrator>C:\oracle\product\Ora10gDSR2\jdk\bin\java -Doracle.security.jazn.config=C:\oracle\product\Ora10gDSR2\j2ee\DevSuite\config\jazn.xml -Doracle.home=C:

  • Messages app is missing

    I installed the new operating system Mavericks and my Messages app has a question mark in the dock. I tried to find it in my application folder and looking for it in my finder and had no luck. What can I do? Thanks AF50