Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cant change window Icon in a JFrame

807598Aug 9 2006 — edited Sep 4 2006
I cannot seem to set the icon in the upper left of the window or in the task. I am using NetBeans and it created my JFrame for me using the following code to initialize:
java.awt.EventQueue.invokeLater(new Unable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
I have checked online tutorials and this seem to be a trully easy task BUT my JFrame, MainFrame, seems not to have the method I need....

I should be able too do this:
MainFrame.setIconImage(Image image); 
But it seems I cannot get that method in my JFrame at all, it just doesnt show up in NetBeans and wont allow me to compile. I have tried looking at the base JFrame class and see no setIconImage there either. Any help would be apriciated.

KN
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2006
Added on Aug 9 2006
15 comments
424 views