Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I replace the standard Java icon?  RSS feed

 
Mike Fernandez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I replace the standard Java icon that displays in the upper left corner of a Java GUI application with an icon of my choice?
Here's my attempt so far:

public class Calculator extends JFrame implements ActionListener
{
private Container container;
private GridBagLayout gbLayout;
private GridBagConstraints gbConstraints;
public Calculator()
{
super( "Calculator" );
addWindowListener(new WindowDestroyer());
container = getContentPane();
gbLayout = new GridBagLayout();
gbConstraints = new GridBagConstraints();
container.setLayout(gbLayout);
// Image loIcon =
Toolkit.getDefaultToolkit().getImage(getClass().getResource("calculator.gif"));
// this.setIconImage(loIcon);
}
}
 
ravindran shanmugam
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This works

- Ravindran.
 
Mike Fernandez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ravindran, it worked perfect.
- Mike
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!