Results 1 to 2 of 2
  1. #1
    Seonix is offline Member
    Join Date
    Aug 2009
    Posts
    1
    Rep Power
    0

    Angry Add Image to JPanel

    Hi,

    I'm pretty new to Java so bear with me ;)

    I am looking for the simplest possible way to add a jpg image to display on a splash screen for a small game. The code I have been given uses JFrame to display the splash screen but also uses a graphics2D object to add items to the splash screen eg
    Graphics2D os = canvas.getOffscreenGraphics();
    os.drawString("Hold down a key depending on which limb(s) you want to move:", 100, 120);
    os.drawString("A - Left Arm", 100, 135);

    Basically just after the simplest way to add an image to the splash screen in the corner.

    Help is much appreciated ;)

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    This link may prove helpful: JavaRanch - Background Image On J Panel

    Please give the suggestion a try and feel free to come on back if it doesn't work fully for you.

    Best of luck and welcome to the forum!

    edit: moving this thread to the Swing forum for better topic alignment.
    Last edited by Fubarable; 08-12-2009 at 02:11 PM.

Similar Threads

  1. Image appear at random co-ord within jpanel
    By IHateNetbeans in forum New To Java
    Replies: 1
    Last Post: 04-30-2009, 07:06 PM
  2. How to display image from byte array in JPANEL
    By waqasdaar in forum AWT / Swing
    Replies: 0
    Last Post: 03-22-2009, 12:11 AM
  3. how to set image to a jpanel
    By masa in forum AWT / Swing
    Replies: 1
    Last Post: 03-02-2009, 08:36 AM
  4. Replies: 5
    Last Post: 11-02-2008, 06:41 AM
  5. Replies: 0
    Last Post: 01-08-2008, 05:29 PM

Posting Permissions

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