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

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

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

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"));

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.