Differences between getImage and createImage and using Toolkit

Discussion in 'Java' started by Thomas Fritsch, Jul 26, 2006.

  1. "Eitan M" <no_spam_please@nospam_please.com> wrote:
    > What are the differences between getImage and createImage,

    See http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Toolkit.html
    The difference is that, getImage involves image caching and createImage does
    not.
    Cited from the API doc of Toolkit#getImage(String):
    "The underlying toolkit attempts to resolve multiple requests with the same
    filename to the same returned Image."
    Cited from the API doc of Toolkit#createImage(String):
    "The returned Image is a new object which will not be shared with any other
    caller of this method or its getImage variant."

    > and what if I want using toolKit - (getImage and createImage are static,
    > and I didn't find a way to create an Image object from a function of
    > toolkit).

    You mean, these methods are *not* static, don't you?
    Click "Use" at the top of the API doc of Toolkit. You find a list of methods
    that return a Toolkit.
    >
    > I need a sample code, please.


    --
    "TFritsch$t-online:de".replace(':','.').replace('$','@')
     
    Thomas Fritsch, Jul 26, 2006
    #1
    1. Advertising

  2. Thomas Fritsch

    Eitan M Guest

    Hello,
    What are the differences between getImage and createImage,
    and what if I want using toolKit - (getImage and createImage are static,
    and I didn't find a way to create an Image object from a function of
    toolkit).

    I need a sample code, please.

    Thanks :)
     
    Eitan M, Jul 26, 2006
    #2
    1. Advertising

  3. > You mean, these methods are *not* static, don't you?
    > Click "Use" at the top of the API doc of Toolkit. You find a list of
    > methods that return a Toolkit.


    e.g. Toolkit.getDefaultToolkit();

    Andrey

    --
    http://uio.imagero.com Unified I/O for Java
    http://reader.imagero.com Java image reader
    http://jgui.imagero.com Java GUI components and utilities
     
    Andrey Kuznetsov, Jul 27, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kris
    Replies:
    2
    Views:
    511
  2. Rob Love
    Replies:
    1
    Views:
    3,329
    dhek bhun kho
    Jul 2, 2003
  3. patrick

    createImage problem

    patrick, Dec 4, 2003, in forum: Java
    Replies:
    8
    Views:
    567
    patrick
    Dec 4, 2003
  4. vizlab
    Replies:
    3
    Views:
    4,261
    Michael Bar-Sinai
    Oct 17, 2007
  5. Chris Berg
    Replies:
    2
    Views:
    483
    Chris Berg
    Oct 31, 2005
Loading...

Share This Page