• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Icon image of frame

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps java.awt.Toolkit.getDefaultToolkit().getImage( String ) is what you are after.
 
Steven Zeng
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic