Results 1 to 11 of 11
  1. #1
    Snowball is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default Help! (How To Make An Image Popup?)

    I am making a Java GUI program that makes an image popup when you lose in a game. I am just wondering if this is possible. If it is, please help me out with my program!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,602
    Rep Power
    23

    Default

    Create a window of some kind that displays the image and then dispose of it after some time delay.

    Why is this thread hidden here vs in the New to Java thread?

  3. #3
    Snowball is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    Can you please give me the syntax of that?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,602
    Rep Power
    23

    Default

    There are several examples of code on this forum. Use the search for the paintComponent method.
    Or look at my recent posts. I think I posted a short simple code example.

  5. #5
    Snowball is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    I thought the paintComponent method is for drawing shapes on a JPanel. So, it can also make images pop up as well?

    (And you did not post a short code example.)

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,602
    Rep Power
    23

    Default

    make images pop up
    No it does not make images pop up.
    The paintComponent method is where you get the reference to a Graphics object that can be used to draw an image.
    You have to create the place for the image to be drawn.

    you did not post a short code example
    Look again. It's there.

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default

    Moved here from Reviews/Advertising. 'Snowball', please take the effort to post in an appropriate section of the forums.

    db

  8. #8
    JDScoot is offline Member
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    24
    Rep Power
    0

    Default

    This may be the thread where Norm posted a short sample code block to do something similar to what you are trying to do:
    Drawing BufferedImage or Graphics2D to window
    If it's not the correct one, you can just click on his user name and scroll through recent posts until you see bits of code.

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,602
    Rep Power
    23

    Default

    Thanks JDScoot. I'm sure you saved the OP a lot of work.

  10. #10
    JDScoot is offline Member
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    24
    Rep Power
    0

    Default

    Was just making sure the OP understood you meant in another thread and not a previous post in this thread. I'm too nice I guess.
    Last edited by JDScoot; 06-16-2011 at 11:15 PM.

  11. #11
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,602
    Rep Power
    23

Similar Threads

  1. How can I make a buffered image solid?
    By rajkobie in forum AWT / Swing
    Replies: 2
    Last Post: 04-17-2011, 08:35 AM
  2. Make a clickable moving image?
    By scheffetz in forum New To Java
    Replies: 1
    Last Post: 04-08-2011, 07:54 PM
  3. How to make a background image
    By Purple Turtle in forum Java Software
    Replies: 2
    Last Post: 11-04-2010, 07:32 AM
  4. To make image move
    By mneskovic in forum New To Java
    Replies: 4
    Last Post: 05-08-2010, 08:23 PM
  5. Replies: 1
    Last Post: 01-15-2008, 07:12 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •