Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Re: Imagedrawing

  1. #1
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Imagedrawing

    Once you have an image in the same folder as your project directory, how to do you get it to show up as an image in a JLabel, JOptionPane, or JButton?

    If I have

    ImageIcon horse = new ImageIcon("Horsey 4.jpg");

    JLabel label = new JLabel("A Horse", horse);

    JPanel = new JPanel();

    panel.add(label);

    panel.setVisible(true);

    label.setVisible(true);

    will that show the image ?

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Imagedrawing

    Quote Originally Posted by javapenguin View Post
    will that show the image ?
    What happened when you tried? Did it show the image?

Similar Threads

  1. Imagedrawing
    By Ironik in forum Threads
    Replies: 5
    Last Post: October 30th, 2010, 09:21 AM