Importing gif file to ImageIcon

Hi,
I am trying to use a gif file that I have included in my project (using Windows XP). I am trying to stick the image from the gif file into a ImageIcon variable, and sticking the variable into a label. Here is the code that I am using to have the program access the gif file:
private ImageIcon redX = new ImageIcon( " \\JAVA programs\\Week 8\\lab8_1a\\redshd.gif " );
I have a classPath setup in my environment variables/system variables as follows:
.;C:\Documents and Settings\Jim Roth\My Documents\Visual Studio Projects\Programs
and the path to the gif file is as follows:
C:\Documents and Settings\Jim Roth\My Documents\Visual Studio Projects\Programs\JAVA programs\Week 8\Lab8_1A\redshd.gif
When I run the program, the screen comes up empty. I am using a basic frame, with a GridLayout. When I change the input into the label to a string, it shows up on the label when the program runs.
In debug mode, I am not quite sure of what the values apply to, but oneonf them shows up as 'null'.
I think my problem lies with the program just not finding the gif.file. Any suggestions?
Thanks a lot!
Jimbo

OK, here is the program.....it is my very first stab at anything gui. We are supposed to display a tic tac toe grid, and have it randomly put x's and o's (or something simiilar) in a3x3 grid in a random fashion. Here it is:
import javax.swing.*;
import java.awt.*;
import java.util.*;
public class TicTacToe extends JFrame
private ImageIcon redX = new ImageIcon("\\JAVA programs\\Week 8\\lab8_1a\\redshd.gif");
private ImageIcon blueCirc = new ImageIcon("\\JAVA programs\\Week 8\\lab8_1a\\qmark.gif");
/** Default constructor for TicTacToe */
public TicTacToe()
setLayout(new GridLayout(3,3,2,2));//sets grid layout for a 3x3 grid with 2 pixel spacing
//add 9 JLabels to hold image icons
for(int i =0; i < 10; ++i)
add(this.generateJLabel());
public static void main(String[] args)
TicTacToe game = new TicTacToe();
game.setTitle("Tic Tac Toe");
game.setLocationRelativeTo(null);
game.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
game.setSize(250, 250);
game.setVisible(true);
protected JLabel generateJLabel()
Random rand = new Random();//instantiate random object to generate ints
int randNum = rand.nextInt(4);//generate ints between 0 and 4 (exclusive)
/*The following switch statement looks at random number generated by the Random
object and assigns an image to a JLabel according to the int returned./
switch (randNum)
case 1:
JLabel temp = new JLabel(this.redX);
return temp;
case 2:
JLabel temp1 = new JLabel(this.blueCirc);
return temp1;
default:
JLabel temp2 = new JLabel();
return temp2;
}

Similar Messages

  • Importing .gif file into Pages - problem with transparency

    Hi Apple Forum,
    First-timer (on the forum) here. I tried importing a .gif image (with alpha channel) into a pages document. The image was imported, but it's not transparent. In other words, the alpha channel isn't working. The problem is NOT with the opacity button, in case some one wants to suggest that as a solution. Has anyone had this issue before?

    Hi Scrambled_Eggs
    Welcome to the forum.
    Resave them as .png from Preview app.
    Peter

  • Can the iPod (30 GB Video version) play animated .GIF files/pictures?

    When I go into the pictures folder, it only shows the first frame. Can it play animations?

    "Importing" .gif files is a very old QT Pro "trick" and was made available in the first "Pro" version of QT (3).
    I still use the feature to add logos or other, older animations to some of my newer QT "movies".
    Some of the older QT tricks can still be used today:
    http://homepage.mac.com/kkirkster/QT_Fun2/
    I've been focusing my skill (very little) on the QuickTime discussions pages but visit these "iPod" discussions pages every now and then.
    Since the new iPod can also "do" the .mov format I thought I'd observe and comment for the newer users.
    Happy New Year!
    Oh, btw, QuickTime can also do some magic with your Photoshop files.

  • Hi Import GIF into AE CC 2014

    Hi to all.
    I try to import a GIF (or animated GIF) to new AE CC 2014.
    But AE returns an error: unable to import *.GIF file is DAMAGED OR UNSUPPORTED
    But for other older AE version GIF worked fine...
    What's happened??
    Can you help me?

    Yeah! I solved installing QuickTime.
    AE use QT library only to import gif/animated gif into the layout.
    Thanks however!!

  • Importing animated gif files

    Hello,
    I have some animated gif files that i would like to import into framemaker.
    The problem is that these animated gif does not activate. Is Framemaker compatible with animated gif's?
    Out of this framemaker file we would like to extract a pdf and a microsoft html help file (via e-publisher).
    How do i keep these gif files animated in Framemaker & pdf?
    We are working with Framemaker 8.0 on a windows vista operating system.
    PDF = adobe acrobat 9 pro.
    Bjorn

    If you are using FrameMaker and WWeP you can certainly use a reference to the animated GIF and pull the animated source into your HTML help from WWeP. Check a WWeP forum on doing that.
    Also, PDF now supports Flash. Have you tried using Flash animations?
    HTH,
    Sean

  • Why won't some .gif files import into Adobe Premiere 11?

    Hello! New to Premiere here.
    I'm working on a project which involves processing roughly 200 animated .gifs taken from the internet. Many of them will import nicely into Adobe Premiere 11.
    The problem is that not all of them will do this. Many of them will give the following message and freeze the entire import process.
    This seems like a strange error message to get because
    a) It seems to say here that the .gif format IS supported
    b) There don't seem to be any codecs for this 11.
    The gif that produced that error message is below:
    What especially frustrates me is that a gif with similar resolution and size will import, but the one above will not. Below is an example of a gif that will import into Adobe Premiere 11:
    Is there an explanation for why this is the case? I have looked up this issue extensively on the internet, and every other person with this issue seems either to be stumped or find a solution for a much older version such as Premiere 8.
    Any help would be greatly appreciated.
    Thank you!

    I'm happy to announce to you all that my "mp4 importing" issues has been sorted out. Now I import mp4 shot with the same Windows Phone 8 Device into Adobe Premiere Pro CS4. Only that for the moment, it doesn't play as fast as with ordinary player.
    But how did I get it to work, you may wonder;
    I simply installed Itunes on the system, I also installed an app called media monkey. I can't say which of the apps did the magic but the next time I tried to import mp4 files into Premiere Pro after these installations, it imported seamlessly.
    Obviously there's a link between the required codecs and the itunes itself.
    You may want to try it and hope it works for you.
    Kindly inform us if it works.
    Thank you all.
    Cheers.

  • The correct way to init an ImageIcon from gif file ?

    What is the correct ( portable, portable, always works etc... ) way to do this :
    ImageIcon icon = new ImageIcon("some_picture.gif"); ?
    use MyClass.class.getResource("some_picture.gif") ?
    Use absolute path ? Relative ? Relative to what ?
    Urgent help needed !
    Our project has a complex structure, something like :
    com.x.y.z.ClassA
    picture in :
    com/x/y/stuff/pics/some_picture.gif
    so we use in ClassA :
    getClass().getResource("../stuff/pics/some_picture.gif");
    But that only works with plain files, it fails when run from a jar !
    ( all the class and gif files are inside the jar )
    We need it to work when executed from files and from jar !
    Also on multiple platforms !
    Help!
    stein

    I use:
    private final static ImageIcon myIcon = new ImageIcon(MyClass.class.getResource("myIcon.gif"));
    and later on use that icon in a JTree and it works. And I have it in a jarfile as well. Relative means that it's relative to where you have your classfiles. Absolute means the complete path (C:\Temp\MyIcon.gif).
    You could use absolute path if you're not sure where your classfiles are..
    Good luck

  • GIF file import

    A have a problem correctly interpreting GIF file characters from an instrument. Any ideas on correctly interpreting a GIF file from an instrument. I'm stuck with the format, its what the instrument supports.
    It appears that MS Windows platform, labview text control interpretation of GIF characters, like \s, \0, \FF, is different from the Agilent E4404B Spec An. I have no problem fetching the file, but characters are being changed (interpreted) whenever I use a labview text box (i.e. an ascii string control, I really need a character control, or some work around).
    Attached is a good GIF from the instrument and the bad imported GIF.
    Solved!
    Go to Solution.
    Attachments:
    bad.GIF ‏16 KB
    00191RMT.GIF ‏16 KB

    Unless I am missing something here, the issue is not with the GIF files per se.  What is happening is that somewhere along the lines the file is being interpreted as text and the nulls (x00) are being replaced with spaces (x20).  You can recreate this by taking the good GIF file, changing the extension to .txt, opening in Notepad, saving, then renaming back to GIF.  You will see that it is no longer a valid GIF and if you examine the file in LV or a hex editor you will see all of the spaces.
    LV does not do this, it may cause trouble if you read a binary file as txt with the convert EOL option selected, but that is about it.  Something happens to the file along the way from the instrument to LV.  That is why I am curious to know how he fetches the file from the analyzer and gets it into LV.

  • How do I add animated .gif files to a JFrame?

    Hi, I'm making an underwater scene in java for my degree assignment. I have a JFrame with an underwater background and a bunch of .gif fish moving around inside, but they should be animated and they're not. They animate outside of java. How can I make the .gif files animate?

    Hi, I'm making an underwater scene in java for my
    degree assignment. I have a JFrame with an underwater
    background and a bunch of .gif fish moving around
    inside, but they should be animated and they're not.
    They animate outside of java. How can I make the .gif
    files animate?A simple example:
    /* save as AnimeGif.java */
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    class AnimGifPanel extends JPanel{
      Image[] imgs;
      int w, h;
      Random rand;
      public AnimGifPanel(Image[] ims, int wid, int hei){
        imgs = ims;
        w = wid;
        h = hei;
        setPreferredSize(new Dimension(w, h));
        setBackground(Color.cyan);
        rand = new Random();
      public void paintComponent(Graphics g){
        super.paintComponent(g);
        for (int i = 0; i < imgs.length; ++i){
          g.drawImage(imgs, rand.nextInt(w), rand.nextInt(h), this);
    public class AnimeGif{
    public static void main(String[] args){
    String filename = "fish.gif"; // an animated gif
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container con = frame.getContentPane();
    Image[] ia = new Image[5];
    for (int i = 0; i < ia.length; ++i){
    ImageIcon ic = new ImageIcon(filename);
    ia[i] = ic.getImage();
    AnimGifPanel agp = new AnimGifPanel(ia, 500, 400);
    con.add(agp, BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);

  • Is there a trick to pasting GIF file or is this a bug?

    I am using 1.4.2 and the following little program is lifted from one of the TechTip articles ( http://developer.java.sun.com/developer/JDCTechTips/2003/tt0318.html#1 ) for illustration purposes.
    The problem is that GIF image pasted from the system clipboard is completely distorted... (it doesn't matter whether the image is originally copied to the clipboard from MS Paint or Adobe PhotoShop).
    Here is a link to what I'm talking about:
    http://home.comcast.net/~viravan/Capture.png
    here is the code:
    DrawImage.java
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.datatransfer.*;
    import javax.swing.*;
    public class DragImage {
       public static void main(String args[])  {
          JFrame frame = new JFrame("Drag Image");
          frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);
          Container contentPane = frame.getContentPane();
          final Clipboard clipboard = frame.getToolkit().getSystemClipboard();
          final JLabel label = new JLabel();
          if (args.length > 0)  {
             Icon icon = new ImageIcon(args[0]);
             label.setIcon(icon);
          label.setTransferHandler(new ImageSelection());
          MouseListener mouseListener = new MouseAdapter()  {
             public void mousePressed(MouseEvent e)  {
                JComponent comp = (JComponent) e.getSource();
                TransferHandler handler = comp.getTransferHandler();
                handler.exportAsDrag( comp, e, TransferHandler.COPY);
          label.addMouseListener(mouseListener);
          JScrollPane pane = new JScrollPane(label);
          contentPane.add(pane, BorderLayout.CENTER);
          JButton copy = new JButton("Copy");
          copy.addActionListener(new ActionListener()  {
             public void actionPerformed(ActionEvent e)  {  
                Action copyAction = TransferHandler.getCopyAction();
                copyAction.actionPerformed( new ActionEvent( label, ActionEvent.ACTION_PERFORMED, (String) copyAction.getValue(Action.NAME), EventQueue.getMostRecentEventTime(), 0));
          JButton clear = new JButton("Clear");
          clear.addActionListener(new ActionListener()  {
             public void actionPerformed( ActionEvent actionEvent)  {
                label.setIcon(null);
          JButton paste = new JButton("Paste");
          paste.addActionListener(new ActionListener()  {
             public void actionPerformed( ActionEvent actionEvent)  {  
                Action pasteAction = TransferHandler.getPasteAction();
                pasteAction.actionPerformed( new ActionEvent(label, ActionEvent.ACTION_PERFORMED, (String) pasteAction.getValue(Action.NAME), EventQueue.getMostRecentEventTime(), 0));
          JPanel p = new JPanel();
          p.add(copy);
          p.add(clear);
          p.add(paste);
          contentPane.add(p, BorderLayout.SOUTH);
          frame.setSize(300, 300);
          frame.show();
    }ImageSelection.java
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.datatransfer.*;
    import java.io.*;
    import javax.swing.*;
    public class ImageSelection extends TransferHandler {
       private static final DataFlavor flavors[] = {
          DataFlavor.imageFlavor
       public int getSourceActions(JComponent c)  {
          return TransferHandler.COPY;
       public boolean canImport( JComponent comp, DataFlavor flavor[])  {
          if (!(comp instanceof JLabel)) {
             return false;
          for (int i=0, n=flavor.length;i<n;i++) {
             for (int j=0, m=flavors.length;j<m;j++) {
                if (flavor.equals(flavors[j])) {
    return true;
    return false;
    public Transferable createTransferable( JComponent comp) {
    if (comp instanceof JLabel) {
    JLabel label = (JLabel) comp;
    Icon icon = label.getIcon();
    if (icon instanceof ImageIcon) {
    final Image image = ((ImageIcon) icon).getImage();
    final JLabel source = label;
    Transferable transferable = new Transferable() {
    public Object getTransferData( DataFlavor flavor) {
    if (isDataFlavorSupported(flavor)) {
    return image;
    return null;
    public DataFlavor[] getTransferDataFlavors() {
    return flavors;
    public boolean isDataFlavorSupported( DataFlavor flavor) {
    return flavor.equals( DataFlavor.imageFlavor);
    return transferable;
    return null;
    public boolean importData( JComponent comp, Transferable t) {
    if (comp instanceof JLabel) {
    JLabel label = (JLabel) comp;
    if (t.isDataFlavorSupported(flavors[0])) {
    try {
    Image image = (Image) t.getTransferData(flavors[0]);
    ImageIcon icon = new ImageIcon(image);
    label.setIcon(icon);
    return true;
    } catch (UnsupportedFlavorException ignored) {
    } catch (IOException ignored) {
    return false;
    Note that pasting .JPG or .PNG files with the same program works fine!
    ;o)
    V.V.

    Just to make sure I understood you, I copied gifs from IE to the clipboard and then used your program to paste them into your app. Right??? Here are the steps for MS-Paint:
    1) activate MS Paint,
    2) load a small gif file (any file will do)
    3) CTRL-A to select the file in MS-Paint, CTRL-C to copy to clipboard
    4) activate the java program
    5) click the paste button in the java program
    Here are the steps in PhotoShop:
    1) activate PhotoShop
    2) load a GIF file
    3) CTRL A to select the entire image or use the tool to select a smaller area and CTRL-C to copy to clipboard
    4 & 5 are same as above
    V.V.

  • How to view gif files...

    Hi
    I have launched swing application in webstart.
    I have used some gif file in my application.
    While creating Jar file I have added all the gif files also.
    But I couln't view that gif files while running the application
    on the webstart.
    Thanks in advance.Kindly help me to solve this problem
    regards,
    selva.

    Hi!
    The following code is my swing application.While running in
    konsole I am able to view the gif file on the Button But,while
    running on java webstart I couldn't view that.
    I have added that gif file in the Jar ARchive.
    import java.awt.*;
    import javax.swing.*;
    class hi extends JFrame
    hi()
    JButton jb=new JButton("Hello");
    jb.setIcon(new ImageIcon("Ergo.gif"));
    this.getContentPane().add(jb);
    this.setSize(200,200);
    this.setVisible(true);
    public static void main(String args[])
    new hi();
    thanks
    regards,
    selva.

  • Gif file not found in JAR from Java Application

    Hello Forumers,
    Could some one please explain how to create a JAR file from where I can get a GIF file. I have tried a number of different ways but it allways fails. (I have tried to add the GIF files using the jar command and I have tried to add it using WinZip after the jar is created).
    To isolate the problem I created this very simple program, the program works very well when the gif file resides on the directory from where I run the Application, but when I remove it from the directory it fails. I have tried to put the GIF file in the JAR in a number of different ways but it allways fails. (I have also tried with and without slash before the name of the GIF). I guess the problem is the way I create the JAR file
    import java.io.*;
    public class GifTest
    { public static void main(String args[])
    { InputStream in = GifTest.class.getResourceAsStream("/open.gif");
    if (in==null)
    System.out.println("Null returned");
    else
    System.out.println("OK");
    Any Hints appreciated
    /Kjell

    Hi,
    here is a small application using my own class GetImageIcon.
    Normally I have this "help-class" in a utility-package to use it from all my projects without copying. For this example I copied the code in the test application. Feel free to use the code of the class like you want. For me it works fine.
    Do the following:
    1. Create a folder called /meta-inf under the folder where the class-files are. Use a text-editor and create a file saved as "manifest.mf".
    manifest.mf tells the jar-file which is the main-class from where the application will start when double-clicked.
    It only has to contain one line:
    Main-Class: GifTest
    2. Compile and create the jar file. I made a bat-file containing:
    javac -verbose GifTest.java
    %pause
    REM Create Jar-File
    jar cmf meta-inf/manifest.mf GifTest.jar *.class *.gif
    REM Show Table of Content of the Jar-File
    jar tf GifTest.jar
    %pause
    So you can see what's in the jar-file.
    3. When you double-click on the jar-file the application is executed. So it is easier to use for the users. They don't have to type in anything on the command-line. You can deploy this jar-file to any client and run it. The only thing you have to do, is to install the JRE on the clients.
    I develop with JDK 1.3.1 and JRE 1.3.1 is installed on the clients of the company I work for.
    //Begin of the code
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.util.jar.*;
    public class GifTest extends JFrame
            protected JLabel m_title;
            protected ImageIcon m_image;
            static File file;
            //You have to define the name of the jar-file
            static String jarFile = "GifTest.jar";
            //Instance of the class GetImageIcon
            protected GetImageIcon gii = new GetImageIcon();
            public GifTest()
                    super("GifTest");
                    setSize(400,200);
                    //the name of the image and the name of the jar-file the image resides in
                    m_image = gii.getImageIcon("orb.gif", "GifTest.jar");
                    m_title = new JLabel(null, m_image, SwingConstants.CENTER);
                    getContentPane().add(m_title, BorderLayout.NORTH);
            public static void main(String argv[]) {
                    GifTest frame = new GifTest();
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.setVisible(true);
    public class GetImageIcon{
    * @param fileName the full qualified name of the file
    * from the root of your application. use a "/" before the
    * fileName, eg. /images/warning.gif
        public ImageIcon getImageIcon(String fileName, String jarName) {
            int counter, c, i = 0;
            byte buffer[];
            JarFile  jfile;
            JarEntry jentry;
            InputStream in;
            ImageIcon m_image;
            try{
                    // Create Jar-File object from JarFile
                    jfile = new JarFile(jarName);
            catch(Exception ex){
                    System.out.println("JarFile-Problem " + "\n" + ex);
                    return null;
            try{
                    // create Jar-Entry object from File-Name in JarFile
                    jentry = jfile.getJarEntry(fileName);
            catch(Exception ex){
                    System.out.println("JarEntry-Problem " + "\n" + ex);
                    return null;
            try{
                    // create InputStream from JarEntry
                    in = jfile.getInputStream(jentry);
            catch(Exception ex){
                    System.out.println("JarEntry-Problem " + "\n" + ex);
                    return null;
            try{
                    //get uncompressed size of entry data in Jar-File and create byte-array with this size
                    buffer = new byte[(int)jentry.getSize()];
                    //write int-value 'c' (casted to byte) with read() and while-loop in byte-Array
                    while((c = in.read()) != -1){
                            buffer[i] = (byte)c;
                            i++;
            catch(Exception ex){
                    System.out.println("in.read()-Problem " + "\n" + ex);
                    return null;
            try{
                    //create ImageIcon with byte-Array 'buffer'
                    m_image = new ImageIcon(buffer);
            catch(Exception ex){
                    System.out.println("ImageIcon-Problem " + "\n" + ex);
                    return null;
            // return the created ImageIcon
            return m_image;
    }

  • .gif files can I mak them?

    I want to create my own Icons. Can I make my own .gif files using Java graphics? I know how to make a .java file using java; can I convert this to a .gif file so I can add it to my Java program as a Icon or .gif file?
    For example,
    cutAction.putValue(Action SMALL_ICON, new ImageIcon("cut.gif"));I want to be able to design my own .gif like the "cut.gif" in the preceding code. I want to do this using Java graphics. Can I simply make a .java graphics panel and save it as a .gif? This question might be pretty far off but I just need a push in the right direction to get the wheels rolling. If anybody could give me a hand the help would be much appreciated.

    Does PNG format support compression in general, and
    how can you achive this with ImageIO in particular?1) Yes.
    2) Apparently it can't.
    Here's how I found out:import java.util.*;
    import javax.imageio.*;
    public class TestPngImageWriter {
      public static void main(String[] argv) {
        Iterator i = ImageIO.getImageWritersBySuffix("png");
        while(i.hasNext()) {
          Object o = i.next();
          Class c = o.getClass();
          System.out.println(c.getName());
          showParam((ImageWriter) o);
      private static void showParam(ImageWriter iw) {
        ImageWriteParam iwp = iw.getDefaultWriteParam();
        System.out.println("WriteParam:\n  " + iwp);
        System.out.println("It " + (iwp.canWriteCompressed() ? "CAN" : "can NOT") +
    " write compressed images.");
    }That's with JDK 1.4.2. 1.5 may do better. Otherwise, it seems like an enhancement request is in order.

  • Animated .gif files

    I have been using an older version of Photoshop Elements for a long time but just got a new MacPro and decided it's time to upgrade my PSE.  But maybe not....I downloaded the Photoshop Elements Trial version to check out if it's really worth upgrading or not and I think I'm in trouble. I have a ton of animated .gif files and they do not appear to open in the familiar "layers".  i read through some of these discussion threads and I think you're saying that if I use the current version of Photoshop Elements I will not be able to edit my old .gif files.  I did try making new layered files and save them for the web with animation and that seemed to work.  But if I'm going to lose the ability to edit my old .gif files I'm not sure I want to upgrade.
    Can someone clarify this for me please.  Maybe it's just a matter of switching from Elements to CS4, but I thought from the descriptions of the programs as provided in the Products section that I fit more with the Elements program.....maybe not???? 
    And this does not even consider that I haven't tried to load my older version on the new intel machine yet, it may not even run if I try that.
    I do, for about 20% of my computing time use "that other" platform, but I don't like it, I much prefer my wonderful Mac machines.
    thanks for your help
    Leigh

    Thank you for your offer, I do appreciae it.  But I think the better question to ask at this point is :  What is the last version of Photoshop Elements that supports editing animated gif files.  This is too important to me to lose this ability and after checking further I see CS4 is out of my price and needed features range. I would rather hang on to my old laptop to manipulate photos than lose the ability to edit my .gif files.
    Can anybody help with this question?

  • Unable to access gif files from the server

    hi all,
    i have successfully signed an applet and it is loading in the client system also. in that applet, i instantiated a jbutton as given below:
    JButton jb = new JButton(new ImageIcon("http://192.168.91.154:8080/success/set.gif"));
    but the icon din appear and a blank button appears, even when accessed from the server system.
    if i give the exact path like c:/blazix/webfiles/success/ set.gif, the icon is coming in the server system but not in other systems. i tried without port no also but in vain. pl solve my problem. what i need is how to
    specify the path of the file[any file] which is present in server.
    or if i put all the gif files in the jar file, can i access the gif files present in the jar file [set for archive] ? if i can, give me the soln for accessing the gif file present in the jar file, so that i need not access the server to get the gif files.(i.e) how to specify the path of the gif files present in the jar file?
    i ve one more doubt. the jni library file shld be in the server, and the client has to access the library in the server. i think the applet loaded in the client ll search for the library in the local m/c only . how to make the applet to search for library in the server??
    i feel only by using rmi we can solve this problem. am i correct? if so i feel that an appln or applet running in the server shld access the jni library, and the applet in the client side should communicate with this server appln using rmi to get the data.is it correct? is there
    anyother way?
    i appreciate your help in this regard. thanks in advance. bye, padmanbhan.

    Better information on what you are doing with JNI might help you get an answer.
    If you have some server process that needs to use JNI, then I would code a servlet to call, instead of using RMI to ge there.
    Depending on your environment, and the target audiences environment, RMI may just cause you a lot of grief. Firewalls etc, get in the way of RMI connections and force security holes to be opened in order to work.
    If you use a servlet, then traffic to your server process is done via standard http calls, which will already be enabled, because your app runs in a browser.
    If ther data requirements are heavy duty, your server could always send an XML stream to the client, which would allow you to describe complex data to the client.
    Running JNI stuff from the client directly means a lot of local infrastructure to run your app. The code you want to run, the JNI library ....
    If what you have is really an application, but want the convenience of starting it from a browser, look at Java WebStart. Then you can distribute an application via the browser, and WebStart will worry about the deployment issues for you.
    In Summary:
    Stay away from RMI from applets if you can help it.
    If you really have an App, then try WebStart to manage the distribution issues for you.

Maybe you are looking for

  • How Do I Back Up My iTunes Purchases On The 11.01 Version?  Please help!

    How do I back up my latest iTunes song purchases on the 11.01 version that I recently upgraded to?  Please help!

  • ICloud and selective downloads (iCloud for a Family 2!)

    I haven't yet updated to iOS 5 because I don't know how to manage our account for a Family, and any help would be greatly appreciated. Presently, we have a single iTunes account linked to my desktop Apple. On it are my wife and I and 2 children. We a

  • How much memory can i upgrade on my macbook pro?

    I have a mid year mackbook pro 2009 with 2gb of memory. When I updated to Lion my system has begun to crawl and barely function. I want to upgrade my memory and I would like to get 8gb of memory from crucial...I don't know if my computer can hold tha

  • Fire Wire 800 VS eSATA interfaces

    Hello, I am looking for a phat hard drive to use with my system. The things that I am pondering; Fire Wire transfer speed as compared to eSATA transfer speed. Is it advisable to step up to a drive that has the eSATA option, or is Fire Wire 800 suffic

  • How do I create a pulp fiction look for my photo

    I've been looking for a good tutorial to create a pulp fiction look for my photos. See the work of artist Thomas Allen who uses real pulp fiction books as an example. How can I recreate the look using Photoshop? I have CS3. What filters or steps shou