• 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

paint() method

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am a bit confused about how the paint() method works.
In the MIDP2.0 spec Canvas, CustomItem and Layer have paint() however if I browse through 3rd party UI libraries I find many classes in them that use paint();
Is there any tutorial, book or website that explains paint()?


 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to explain more what you looking for.
For example you can get general info and examples on use of CustomItem from Beginning J2ME book, plus internet is full of other materials
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
paint() is the method that gets called to render graphics objects into the GUI. Each visual component will have a paint() method implemented that draws whatever items are required to make itself visible. So a background component would draw the application background, the button components would each draw their associated buttons, and so on for the labels and text input controls, and so forth. Including any custom components you may have defined. Parent components ensure that their children get painted when the parent is repainted, which they may do explicitly, or in some cases, because the master paint method simply runs through all affected components in turn.

For performance reasons, paint requests are often placed on a queue and executed by an independent painting thread. The primary GUI thread usually caused these requests to be queued by calling some sort of invalidate() or repaint() method to indicate that an update (paint) is needed. In the case of complex desktops, moving other applications over the current application's display (or removing them from overlaying the current app) can also cause the app's GUI framework to queue up paint requests.
 
Scott Roberts
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Tim

That pretty much explains it! Thanks!
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic