• 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

Creating a 'background'

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to set a 'background' image for a more or less menu system I am working on.
I have a bunch of classes that extend java.awt.Panel, and I want to set backgrounds for each of these.
I know I can paint the screen, and any components I add (Checkboxes, Labels, etc.) will 'paint' over the painted image, the problem I have, is getting the image.
I know there is a getImage() method in java.awt.Applet, and I can use that to get the image and pass to the extended Panels, but I would like to do as much of the 'work' in the Panels as possible, rather than the Applet.
Does anyone have any ideas, suggestions, on what I can do to accomplish this??
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use Toolkit.getDefaultToolkit().createImage().
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic