blackberry - Calling a customFields paint method -


i working on application displays chart on screen. made custom field paint function renders chart. want know how can call function chart shown. have attatched sample code here see blank white screen.

public class graph extends mainscreen {        class myfield extends field        {             protected void layout(int w,int h)             {                   setextent(getwidth(),getheight());             }              protected void paint(graphics g)             {                     //my graph drawn here             }              public myfield()             {                  paint(getgraphics());             }       }        public graph()       {           verticalfieldmanager vfm=new verticalfieldmanager();           vfm.add(new myfield());           add(vfm);       } } 

one thing notice getwidth() , getheight() calls being used set extent. until you've finished calling setextent(), getwidth() , getheight() return 0. should doing own calculations determine how wide , tall field is, , set extent (as long less max width , max height being passed layout(). also, isn't necessary call paint() constructor, manager in make call when needs painted.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -