0

Hi

How can i change my application default java icon with my own?
The problem is that my frame dont have a name =(

.....

 public Main() {
        super("PDB Viewer");

    GLCapabilities caps = new GLCapabilities();
    caps.setDoubleBuffered(false);

    canvas.addGLEventListener(new SecondGLEventListener());
    canvas.addKeyListener(new SecondGLEventListener());

    getContentPane().add(canvas, BorderLayout.CENTER);
    canvas.requestFocus();


        initComponents();
        pack();
        setBounds( 150, 20, 800, 750 );
        
    }

.....

Something above...

Thanks :D

3
Contributors
5
Replies
9
Views
6 Years
Discussion Span
Last Post by stultuske
0

what do you mean? your jar file to have another icon? your frame to have another icon in the bar on top of it???

0

what do you mean? your jar file to have another icon? your frame to have another icon in the bar on top of it???

oh, yeah yeah, i want my frame to have another icon, instead of default java icon

0

Hi

How can i change my application default java icon with my own?
The problem is that my frame dont have a name =(

.....

 public Main() {
        super("PDB Viewer");

    GLCapabilities caps = new GLCapabilities();
    caps.setDoubleBuffered(false);

    canvas.addGLEventListener(new SecondGLEventListener());
    canvas.addKeyListener(new SecondGLEventListener());

    getContentPane().add(canvas, BorderLayout.CENTER);
    canvas.requestFocus();


        initComponents();
        pack();
        setBounds( 150, 20, 800, 750 );
        
    }

.....

Something above...

Thanks :D

Try this:

window.setIconImage(Toolkit.getDefaultToolkit().getImage("image.gif"));
0

Try this:

window.setIconImage(Toolkit.getDefaultToolkit().getImage("image.gif"));

he would've found this in the example I provided earlier..
in order to read your post clear, you might also want to specify the class of which "window" is an instance of.

This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.