Results 1 to 2 of 2
  1. #1
    Teh Brian is offline Member
    Join Date
    Mar 2009
    Posts
    1
    Rep Power
    0

    Default How to output to panel as a .gif

    Hey guys

    I'm still a bit of a newbie but I'm writing a program that calculates the result of a formula and then outputs the sum (int) onto a panel. Now I've got it outputting to the panel just fine using the g.drawstring method, but I'd like to use images of numbers that I've created in Photoshop as they look better.

    Is this relatively easy, or even possible to do? I've created the numbers 0-9 in Photoshop as .gif files.

    Many thanks.

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

    Default

    You could create ImageIcons out of the images and place these icons on JLabels as needed and display your result this way. You'll need to learn about using various layout managers such as the BoxLayout (if you don't already know about these), but fortunately there's much info on layouts and on using JLabels on the Sun Swing tutorial.

Similar Threads

  1. panel resizing
    By kumar_gemi in forum New To Java
    Replies: 3
    Last Post: 03-13-2009, 03:51 AM
  2. Java, output string, getting correct output? HELP!
    By computerboyo in forum New To Java
    Replies: 2
    Last Post: 02-26-2009, 12:44 AM
  3. panel positioning
    By shwein in forum New To Java
    Replies: 4
    Last Post: 09-09-2008, 06:15 PM
  4. add image on panel
    By samiksha.goel in forum AWT / Swing
    Replies: 4
    Last Post: 08-02-2008, 08:38 PM
  5. Help with drag from panel
    By fernando in forum AWT / Swing
    Replies: 2
    Last Post: 08-07-2007, 11:19 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
  •