user1610541
user1610541

Reputation: 111

Setting frame icon

Okay, so after everything i finally have the base of my game up and running! the only thing is the default window icon is the lwjgl logo :L can someone please tell me how to change this to my custom icon?

Upvotes: 0

Views: 96

Answers (2)

Rainer.R
Rainer.R

Reputation: 458

        /* Display the Application Icon */
        BufferedImage images = null;
        try {
            images = ImageIO.read(mainFrame.getClass().getResource("/sample/resources/icon.gif"));
        } catch (IOException es) {
            es.printStackTrace();
        }
        mainFrame.setIconImage(images);

Upvotes: 0

Dan D.
Dan D.

Reputation: 32391

For a JFrame, use setIconImage(Image image).

Upvotes: 1

Related Questions