Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Contributor
Posts: 4
Registered: ‎04-05-2010
My Device: 8300
My Carrier: df
Accepted Solution

"Not - full screen" application possible ?


I am trying to create an App that will not span over full display.
Is there a way to do this in BB?


package Test;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.Display;
import net.rim.device.api.system.Application;

 * name:灰太狼大王
public final class Test extends UiApplication{
           Ui.getUiEngine().pushGlobalScreen(new HelloScreen(), 1, UiEngine.GLOBAL_QUEUE);  
    public static void main(String [] arg){
        Test app=new Test();
    private  final class HelloScreen extends PopupScreen{
         private final int screenW=Display.getWidth();
         private final int screenH=Display.getHeight();
         private final int _W=screenW*8/10;
         private final int _H=(Font.getDefault().getHeight()<<1)+30;
         private final int _X=(screenW-_W)>>1;
         private final int _Y=(screenH-_H)>>1;
         private final String tipzh1="11111";
        public HelloScreen(){   
            super( new VerticalFieldManager( Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR ));
        public boolean keyDown(int keycode, int time){
            System.out.println("keyDown keyCody="+keycode);
            char key=Keypad.map(keycode);
           return true;
          // return super.keyDown( keycode, time );
        public  boolean  keyRepeat(int keycode, int time){
              System.out.println("keyRepeat keyCody="+keycode);
             return true;
          // return super.keyRepeat( keycode, time );
        public  boolean keyChar(char c, int status, int time){
             System.out.println("keyChar char="+c +" status="+status);
             return true;
            // return super.keyChar(c,status,time);
       protected void paint(Graphics graphics){
          //  super.paint(graphics);

          // super.paint( graphics);

        protected  void paintBackground(Graphics g){
            XYRect myExtent = getExtent();
            int color = g.getColor();
       public void sublayout( int width, int height ){
           setPositionDelegate(_X, _Y);
           setPosition(_X, _Y);





I am doing this but the whole screen gets painted white (except, of course, the popup window)

any idea ?

New Contributor
Posts: 4
Registered: ‎04-05-2010
My Device: 8300
My Carrier: df

Re: "Not - full screen" application possible ?

Do you understand me?

I am  not strong in English.

Posts: 17,024
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: "Not - full screen" application possible ?

screens in uiapplications always have white backgrounds.


your only option would be to use global popupscreens which can be of a limited size (but have lots of other limitations)

feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 4
Registered: ‎04-05-2010
My Device: 8300
My Carrier: df

Re: "Not - full screen" application possible ?

Can you give me more detail, then?

an example ?

Thank you!

Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: "Not - full screen" application possible ?

Just to repeat Simon's points, If an Application is in the foreground, the Blackberry expects it to use the whole screen.


If you want to pretend it is not using the whole screen, then take a screen shot when your app starts, and use that as the background. 


Restrictions on Global Screens include

a) not supporting Fields that have popups, like the Date/Time

b) Not supporting Menus

c) Hiding other global Popup Screens, that might be telling the user something important.


I would not consider writing an application based on using these.