• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Icon image of frame

 
Steven Zeng
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now i found a problem at changing the icon image of frame from the default java symbol.I found a method defined in the class of java.awt.frame -
setIconImage(Image image) , but i don't konw how to use the image argument to specify the image i want use in the frame.Thanks.
 
Dirk Schreckmann
Sheriff
Posts: 7023
 
Steven Zeng
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Dirk, you know, the class you offered is a abstract class ,but I don't know how to get a instance of that class , if I don't want to create a subclass of it,can I use java.awt.toolkit class?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Toolkit.getDefaultToolkit() gets the real Toolkit on your system... the implementing class is package private because it changes based on system and you shouldn't access it directly.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic