tags:

views:

21

answers:

1

i am developing a blackberry app. i want to paint the screen. i have implemented this

VerticalFieldManager hfmBg = new VerticalFieldManager(Field.USE_ALL_HEIGHT )
            {
                protected void paint(Graphics g)
                {

                    g.setBackgroundColor(Color.SILVER);
                    g.clear();
                    super.paint(g);
                }//end of paint method
            };//end of vertical field manager

but tell me is there any other approach to paint the whole screen?

A: 

You have the right idea - just put that paint method in your Screen (MainScreen or FullScreen) class instead of your Manager class. You may also have to add the following empty method to your Screen class to override themes that set the default colors:

protected void applyTheme() {
}
Marc Novakowski
can u please tell me how to put it in screen class?
Well - you're adding your VerticalFieldManager to something via add(hfmBg) - that something is most likely the Screen class.
Marc Novakowski
i have tried doing it throughMainScreen screen = new MainScreen(){protected void paint(Graphics g) { g.setBackgroundColor(Color.SILVER); g.clear(); super.paint(g); }//end of paint method};but it doesnt work
moreover what to do with class that extends MainScreen?
Once you create the screen you push it onto the stack using UIApplication.pushScreen()
Marc Novakowski