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: Why is my icon image is not changing can you help with that?

  1. #1
    Junior Member
    Join Date
    Aug 2021
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Why is my icon image is not changing can you help with that?

    package projects;

    import javax.swing.*;

    public class Projects {
    public static void main(String[] args) {

    JFrame frame = new JFrame();
    frame.setSize(500,500);
    frame.setVisible(true);
    frame.setResizable(true);

    ImageIcon image = new ImageIcon("logo.PNG");
    frame.setIconImage(image.getImage());


    }

    }

  2. #2
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    112
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Why is my icon image is not changing can you help with that?

    You are working with Java programs in a browser that works on a Windows platform. Most times. So the changing of pictures must be written within the program for your project with pictures to work also. Seperate folders. Usually on NetBeans. I think this was already brought up. But I forgot what I said already. So just reiterating what may have been said already.

    --- Update ---

    I don't know if this is going to make things clearer, but starting with JFrames and working on URLs, Java makes it possible for anyone to upload other files to a URL. So getting really familiar with Java programming and the web, is a great place to start and expand on Java programming. Then you can try out making a whole system. I got an download buttons that is an extension file. But it was Java program icon but fixated on my browser. Download other files that cannot be downloaded. Private members only. Like P-interest.

Similar Threads

  1. Image folder-icon
    By almir97 in forum JavaFX
    Replies: 12
    Last Post: March 6th, 2021, 10:38 AM
  2. [SOLVED] Image Icon problem
    By xkendzu in forum Java Theory & Questions
    Replies: 4
    Last Post: February 3rd, 2014, 03:50 PM
  3. Two questions: setting an image icon and closing up a game
    By MW130 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 24th, 2014, 03:46 AM
  4. Replies: 0
    Last Post: February 14th, 2011, 06:10 AM
  5. Stupid thing can't find image icon right in front of it!!!
    By javapenguin in forum What's Wrong With My Code?
    Replies: 14
    Last Post: July 9th, 2010, 01:02 AM

Tags for this Thread