TITLE BACKGROUND

How can I change the background of the title in a screen? I want to put an image with transparent background and then set different background colors in the different screens. Is this possible?

You can pass any type of manager in the setTitle method... If a Manager customized with your favorite painted background can be passed...

See you soon...

Tags: BlackBerry Developers

Similar Questions

  • can bbUI.js & .css, I change bb-type_donnees = "item" title background?

    Hello forum, Iam using bbUI.js & .css (9.6), how to change article backround color of the image list?

    is there any tag, which gives me this option?

    listItem.setAttribute ('style', ' make-weight: bold; text-shadow: 3px 2px 3px rgba (150, 150, 150, 1);) ") ;

    Has worked... Thanks for the tip.

  • How to set the background color of the title?

    Generally, the title background color is black and the other area of the main screen is white. I want to set the background color of the linear gradient background as blue or something. I try the following 2 ways, but there is always a black line at the bottom of the title bar.

          Background background = BackgroundFactory
                    .createLinearGradientBackground(0x00ff0000, 0x00ff0000,
                            0x0000ff00, 0x0000ff00);
            LabelField title = new LabelField("Hello World Demo",
                    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
            title.setBackground(background);
            setTitle(title);
    
           LabelField title = new LabelField("Hello World Demo",
                    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    
            HorizontalFieldManager hrzManager = new HorizontalFieldManager() {
                protected void paintBackground(Graphics graphics) {
    
                    graphics.setBackgroundColor(0x00382B79);
                    graphics.clear();
                    super.paint(graphics);
                }
            };
            hrzManager.add(title);
            setTitle(hrzManager);
    

    Hello

    I think that there may be a problem using the default setTilte() method.

    Have something by default, behavior with the device.

    It may be a way to customize the default title to remove the black line at the bottom of the title bar.

    But I suggest an alternative that will behave like the title bar without using the setTitle() method.

    You can use something like below to get your condition.

    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.*;
    
    class TestScreen extends MainScreen{
    
        private VerticalFieldManager verticalManager;    private HorizontalFieldManager hrzManager;
    
        TestScreen()     {            super(NO_VERTICAL_SCROLL);
    
            LabelField title = new LabelField("Hello World Demo",                        LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    
            hrzManager = new HorizontalFieldManager()         {            protected void paintBackground(Graphics graphics)             {                graphics.setBackgroundColor(0x00382B79);                graphics.clear();                super.paint(graphics);            }        };        hrzManager.add(title);        this.add(hrzManager);
    
            //rather than  adding component in the mainScreen        //add components in this verticalManager and then        // add this manager to mainScreen          verticalManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR)        {            /*              public void paint(Graphics graphics)            {                graphics.setBackgroundColor(0x00ffffff);                graphics.clear();                super.paint(graphics);            }            */                        protected void sublayout( int maxWidth, int maxHeight )            {                int width = Display.getWidth();                int height = Display.getHeight() - hrzManager.getHeight();
    
                    super.sublayout( width, height);                setExtent( width, height);            }        };
    
            ButtonField button1 = new ButtonField("Button1");        ButtonField button2 = new ButtonField("Button2");        ButtonField button3 = new ButtonField("Button3");        ButtonField button4 = new ButtonField("Button4");        ButtonField button5 = new ButtonField("Button5");
    
            verticalManager.add(button1);        verticalManager.add(button2);        verticalManager.add(button3);        verticalManager.add(button4);        verticalManager.add(button5);        this.add(verticalManager);
    
        }}
    

    Concerning

    Bika

  • Change the background color of the title in first item 11

    PC Windows 10 - First item 11

    Hello everyone,

    I'm trying to change the background of the securities, which is in default in black but I can't

    I saw this: https://forums.adobe.com/thread/1981783?q=change%20color%20background%20title but in item 11 it seems not the same

    In thought, I had to click in the black of the title background, then, right click on the color of propriety, but it was not allowed:

    In fact, I just want to change the black and white!...

    Please, is there anyone who can help me?

    (Sorry for my bad English)

    Thank you very much

    I did the too small and orange form, but you can make any size and any color.

    But IMO its easier to put a white matte under your text color.

    Just cut the logo were the beginning of the interview and move everything on the left a higher track.

  • Expand the background Image to cover across the region title

    I have a region title that contains an image and it has a height of 2 rows, but the background image (blue image) is not growing in the region (the css contains repetition for background). The application uses the theme 2. Can anyone help?

    CSS:
    .rc-title {
        background: url("../images/bg-region-blue-l.gif") repeat scroll 0 0 transparent;
        float: left;
        width: 100%;
    }
    div.rc-blue-top
    {
        background: url("../images/bg-region-blue-l.gif") repeat scroll 0 0 transparent;
        float: left;
        width: 100%;
    }
    I created the application on the APEX. ORACLE.COM:
    Workspace: RGWORK
    User: TESTER
    Password: test123
    Application: CSRSR (33558)

    Select view from the menu (only choice).

    You will see that the tabular forms a dog tags and an image, another tabular form has a picture but no text (nameplates), even if it is there. I live blue to cover the image and the text.

    Help, please

    DB: 10g
    APEX 4.1

    4.2 APEX (APEX. ORACLE.COM) works the same way.

    Robert
    http://apexjscss.blogspot.com

    sect55 wrote:
    fac586,
    I would like to try the second option:
    >
    Another option would be to eliminate the problem by moving images of the nameplate on the titles of the region. There is a horizontal space within the regions that will allow these images to be rotated to the left of tabular form, that would look OK. But how to refer to the horizontal space within the regions? I looked at the model for the region:

    #TITLE#
    #CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#
    #BODY#

    and could not put the image in horizontal space.

    Can you please help me by providing the details?

    There are two options, depending on the role you see images of the plate by playing on the page. I used the two regions to give an example of each.

    * 1. Nameplate as eye-candy: * If there is sufficient information on the region, contained region title and labels of items to make the images of the nameplate of the superfluous by providing information to the user and you are just using them to improve the appearance of the page, then they can only be applied using CSS.

    /* Nameplate image as CSS eye-candy */
    #nameplates-ndc div[id$="catch"] {
      min-height: 36px;
      padding-left: 113px;
      background: transparent url(#WORKSPACE_IMAGES#nameplate_ndc.gif) top left no-repeat;
      background-size: 103px;
    }
    

    Note the use of the CSS3 background-size property to resize the image. If the application needs to work in browsers that do not support this so you will have to drop it and create an image of the exact size required for use in the bottom rule.

    * 2. Nameplate as content: * If the plate images are necessary to provide information to the user, then they should be included in the region (and they must have an alt attribute, providing an alternative representation of the information contained in the image).

    Put the image in the header area:

    Nameplate (name only)
    

    and it floats so it sits next to the form:

    /* Nameplate image as page content */
    #nameplates-name .rc-content-main img {
      float: left;
      margin-right: 10px;
    }
    
  • Titles with transparent background - how? PE-10

    Hello

    When I do a title it shows clear transparent on my video-photo - as you wish - in the preview window.

    When sharing this video the title background black and the background video-image is not visible.

    I am perhaps doing wrong?

    Kind regards

    Koen

    When you have a title or a video Clip on another element, another way to do the Fade Out is to add a Dip - in-black to the top tether, or title. Who will have the entire black screen. Many Transitions, such as crossfade and Dip - to-black may be unilateral or bilateral. As Dip - to-black will take the upper part (more Video Track) Clip to the black, which will do the same for the Clips below.

    In your screen-cap, the title is in the Source monitor, which is most often used to trim a Clip, or a title. This Clip, or a title, takes over in the monitor Source by Dlb-clicking on it in the project Panel or in the case of a video Clip on the timeline. To load the title in the Titler (construction of the Panel title), it would be Dbl Click on it in the Timeline. Titration module is where it creates or changes the titles, and it has a set of tools along the right, but a Panel of Styles.

    How did you create your title? If done module titration and you did not use all forms, she should have a transparent background. If the title has been created, it may, or may not, with a transparent background. Say that you create your title in Photoshop, or PSElements, on a black background, rather than with a transparent Background (note italic, as they refer to the lowest in a PS Image layer), then the title is black opaque and lacks transparency. That's why I ask how and where the title has been created.

    Pre, assets stacked above the others in the video tracks in the Timeline, are just like sheets of acetate, or like the layers in PS and will cover everything below, unless there are "holes" in the superior asset, or transparency. Unfortunately, it may look a little confused in the Meadow, that transparency is not displayed in the same way as with the PS, which, by default, displays a gray/white checkered pattern. In the pre, it will show as not black, although it is transparent - no motive checkerboard - just nothing, so we see it in the dark.

    With the titration module, the background is transparent, until something is added to it, to give it a certain opacity, as Type, shape or the work. With an image editing program, this context are usually opaque, unless steps are taken to create with a transparent background and then stores it in a format that supports transparency, PSD, PNG, etc... Most of the image formats do not support transparency.

    Let us know just a little more on your title, and where and how it was created.

    Good luck

    Hunt

  • How to get the background color setting after accidentally change?

    Original title: background and other color changes
    I changed the background color by accident and cannot get the original settings that I had back

    Hello

    1. who is the operating system installed on the computer?
    2. what was the background color and what color you have changed from?
    3. What are other color changes you're talking about?
    4. What are the steps you did to change the background color?
     
     
    If you work on a windows 7 OS then try the steps in the following article and check the status of the issue.
     
     
    I hope this helps!
  • Can not change the background appearance in Windows XP computer.

    Original title: background appearance

    I can't change my background appearance because when I click on the icon and click on the appearance tab, it seems that the control of my background appearance was disabeled and I don't know how to reactivate it. Can you tell me how to re-enable this function within the display icon?

    Hi sandradecker,

    This computer is connected to a domain? You are able to change the appearance of the desktop from another user on this computer account? If necessary, follow the steps in this document to create a test user account.

  • Try to change the background color to the default settings on windows XP Professional

    Original title: background colors of Windows

    A few months ago something apparently got reset or changed the way my colors of background on web pages are displayed. I tried to get this return a default value for Windows xp professional but nothing I have seems to work. I am at a loss as to why or how this has changed. If anyone can help me with a few solutions for this I understand that.

    Thank you for your help

    Hello

    1 have. what measures you tried?

    See the bottom of the articles that might help you change the background color.

    To customize a background color
    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/display_change_background_color.mspx?mfr=true
    To change the background properties, graphic, text, colors and fonts
    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/nt_sysmon_copysetappearancerproperties.mspx?mfr=true

  • How to remove background noise

    original title: BACKGROUND NOISE

    BEING A LITTLE AMATEUR, I WAS LOOKING THROUGH THE "SOUND EFFECTS" AND BACKGROUND NOISE ADDED 'LIVING ROOM'.  I THOUGHT THAT I HAD CANCELLED IT BUT IS STILL AUDIBLE. SO NOW, I DON'T REMEMBER WHERE I FOUND THE "PLACE" TO DO THIS AND TO STOP THIS RACTIC. THANKS FOR ANY HELP. ONCE I AM ABLE TO FIND THE FILE OR WHAT 'RENT', I SHOULD BE OK.  Thank you.

                                                                 * E-mail address is removed from the privacy * or * E-mail address is removed from the privacy *

    First of all, please do not use all capital letters, it is considered as shouting.

    All the 'effects' are in the sound control panel.

  • Windows Vista cannot see this background image instead, I see a solid blue color during startup and shutdown

    original title: background logon of windows vista I do not see this background image instead, I see a solid blue color during startup and shutdown

    I use a laptop with windows vista home basic 32-bit sp2

    After turning on the computer laptop, I get a prompt to enter the password at this point, I would usually get a background image and the same background image appeared when I stopped

    I do not see this background image instead, I see a blue solid color when you start and stop as the background image has been replaced by a blue color

    I followed all the steps of the following

    http://www.howtogeek.com/HOWTO/Windows-Vista/customize-your-Windows-Vista-logon-screen/

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-desktop/can-you-customize-the-logon-screen/75def0ce-2dc4-48c1-B290-daaf685efca4

    http://www.Vistax64.com/tutorials/79886-logon-screen-change.html

    However, I don't see the background image. the background image is in the right folder location whith the required size as jpg image with the exact registry required such as mentioned in the above links entries

    How do I solve this problem

    Hello

    Did you do changes on the computer before the show?

    You can try the steps and check if you are able to see the background on the logon screen.
    a. Click Start, and then type gpedit.msc
    b. navigate to Computer Configuration and go to administrative templates and go to System.
    c. go to connection and set the "bottom always use custom logon" to activate.
    d. create a folder named C:\Windows\System32\oobe\info\backgrounds
    e. put the file you want, and then name it backgroundDefault.jpg
    f. check your other background for the dimensioning of the info files

  • How to change the background image list?

    Hi forum, I am using bbUI.js & css (v0.9.5), can I change bb-type_donnees = "item" title background?

    found...

    listItem.setAttribute ("style", "font-size: 32px;") make-weight: bold; background-color: #000 ');

  • Cannot set image as background

    original title: background image problems

    Im trying to change my background to a personal image image, but my computer only will allow me to change it to a solid how can I solve the problm

    Wallpaper,
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-desktop/unable-to-change-the-themes/937bfed2-df8f-4980-a55c-0171bf3de139

  • How to keep the taskbar visible

    original title: background bar rising problem

    Dear informer

    Please tell me how 2 stop the bottom to rise bar & 2 bring down when it's... like now! THANKU!

    Drag the taskbar to the bottom and then right-click on it and lock it.

  • The application to display very slowly, please give me advice, thanks.

    Dear all,

    Could someone give me some advice? Thanks, I'm new developer in the development of a program administered for BB bold 9000, but when I run the application, it was display very slowly. Thank you.

    My code is displayed as follows:

    Main:

    import net.rim.blackberry.api.browser.Browser;
    import net.rim.blackberry.api.browser.BrowserSession;
    import net.rim.device.api.servicebook.ServiceBook;
    import net.rim.device.api.servicebook.ServiceRecord;
    import net.rim.device.api.system.Characters;
    import net.rim.device.api.system.EncodedImage;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.BitmapField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Background;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    
    public class SmartoneVodafoneServices extends UiApplication {
    
        public static void main(String arg[]) throws Throwable {
            SmartoneVodafoneServices application = null;
            application = new SmartoneVodafoneServices();
            application.enterEventDispatcher();
        }
    
        public SmartoneVodafoneServices() throws Throwable {
                pushScreen(new SmartoneVodafoneServicesScreen());
        }
    }
    
    class SmartoneVodafoneServicesScreen extends MainScreen {
    
        //private TableLayoutManager table = TableDefine();
        private String url = "http://202.140.96.134:8080/Hero/shortcuts_demo.xml";
        private static ServiceBook sb = ServiceBook.getSB();
        private static ServiceRecord[] records = sb.findRecordsByCid("BrowserConfig");
    
        public SmartoneVodafoneServicesScreen() throws Throwable {
            super();
            LabelField title = new LabelField("Smartone Vodafone Services",
                    DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.HCENTER);
            setTitle(title);
    
            Background bg = BackgroundFactory.createSolidBackground(Color.BLACK);
            getMainManager().setBackground(bg);
            String[][] arr = null;EncodedImage pic = null;int p = 0;
            UiApplication.getUiApplication().getScreenCount();
            arr = Conn.WorkForXML(url);
            HorizontalFieldManager mainHManager = new HorizontalFieldManager(Field.FIELD_VCENTER);
            VerticalFieldManager col1 = new VerticalFieldManager(Field.FIELD_HCENTER);
            VerticalFieldManager col2 = new VerticalFieldManager(Field.FIELD_HCENTER);
            VerticalFieldManager col3 = new VerticalFieldManager(Field.FIELD_HCENTER);
            VerticalFieldManager col4 = new VerticalFieldManager(Field.FIELD_HCENTER);
            VerticalFieldManager col5 = new VerticalFieldManager(Field.FIELD_HCENTER);
    
            for (int i = 0; i < arr.length; i++) {
                if (arr[i][0] != null || arr[i][1] != null || arr[i][2] != null) {      
    
                    LabelField name = showName(arr[i][0]);
                    pic = Conn.GetPngField(arr[i][1]);
                    final String link = arr[i][2];
                    //final String link = "http://202.140.96.134:8080/blackberry/index.html";
                    BitmapField myBitmapField = new BitmapField(pic.getBitmap(),Field.FOCUSABLE|FIELD_VCENTER){
                        protected boolean invokeAction(int status){
                            //BrowserSession site = Browser.getDefaultSession();
                            BrowserSession site = createWAPBrowserSession();
                            site.displayPage(link);
                            return true;
                        }
    
                        protected void paint(Graphics g) {
                            g.setBackgroundColor(Color.BLACK);
                            g.drawRoundRect(0, 0, getWidth(), getHeight(), 10, 10);
                            g.setColor(Color.WHITE);
                            super.paint(g);
    
                        }
                    };
    
                    switch (p) {
                        case 0:
                            col1.add(new LabelField(" ",LabelField.NON_FOCUSABLE));
                            col1.add(myBitmapField);
                            col1.add(name);
                            break;
                        case 1:
                            col2.add(new LabelField(" ",LabelField.NON_FOCUSABLE));
                            col2.add(myBitmapField);
                            col2.add(name);
                            break;
                        case 2:
                            col3.add(new LabelField(" ",LabelField.NON_FOCUSABLE));
                            col3.add(myBitmapField);
                            col3.add(name);
                            break;
                        case 3:
                            col4.add(new LabelField(" ",LabelField.NON_FOCUSABLE));
                            col4.add(myBitmapField);
                            col4.add(name);
                            break;
                        case 4:
                            col5.add(new LabelField(" ",LabelField.NON_FOCUSABLE));
                            col5.add(myBitmapField);
                            col5.add(name);
                            break;
                    }
                    p ++;
                    if ( p == 5 ){
                        p = 0;
                    }
                }
            }
            mainHManager.add(col1);
            mainHManager.add(col2);
            mainHManager.add(col3);
            mainHManager.add(col4);
            mainHManager.add(col5);
            add(mainHManager);
        } 
    
        public LabelField showName(String name) {
            return new LabelField(name,LabelField.NON_FOCUSABLE|LabelField.FIELD_VCENTER){
                protected void paint(Graphics g) {
                    Font myFont = Font.getDefault().derive(Font.PLAIN, 7);
                    g.setColor(Color.WHITE);
                    g.setFont(myFont);
                    super.paint(g);
                }
            };
        }
    
        public static BrowserSession createWAPBrowserSession()
        {
            // If there are browser services found - search for the WAP2
            // Service Record
            String uid = null;
            int numRecords = records.length;
            for( int i = 0; i < numRecords; i++ )
            {
                ServiceRecord myRecord = records[i];
                //if (myRecord.getName()){
                if (myRecord.getUid().equals("WAP Browser Smartone")==true){
                    uid = myRecord.getUid();
                }
            }
            return Browser.getSession(uid);
        }
    
        public boolean keyChar(char key, int status, int time)
           {
               switch (key) {
                   case Characters.ESCAPE:
                        System.exit(0);
                        break;
               }
               return true;
               //return true to indicate that a key was pressed
           }
    }
    

    Conn.Java

    import java.io.*;
    
    import javax.microedition.io.*;
    
    import net.rim.blackberry.api.browser.Browser;
    import net.rim.blackberry.api.browser.BrowserSession;
    import net.rim.device.api.math.*;
    import net.rim.device.api.servicebook.ServiceRecord;
    import net.rim.device.api.system.*;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BitmapField;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    import net.rim.device.api.xml.parsers.*;
    
    import org.w3c.dom.*;
    
    public class Conn {
    
        /**
         * @return
         * @throws IOException
         * @throws Throwable
         * @throws Throwable
         */
    
        public static String[][] WorkForXML(String url) throws IOException, Throwable {
            // TODO Auto-generated method stub
            String[][] arr = null;
            HttpConnection conn = null;
            Document doc;
    
                conn = (HttpConnection) Connector.open(url);
                conn.setRequestMethod(HttpConnection.GET);
    
            try {
                if (conn.getResponseCode() == HttpConnection.HTTP_OK) {
    
                    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    
                    docBuilder.isValidating();
                    doc = docBuilder.parse(conn.openInputStream());
                    conn.close();
                    doc.getDocumentElement().normalize();
    
                    NodeList list = doc.getElementsByTagName("item");
                    arr = new String[list.getLength()][3];
    
                    for (int i = 0; i < list.getLength(); i++) {
                        Node nNode = list.item(i);
                        NodeList sList = nNode.getChildNodes();
    
                        if (sList.item(1).getFirstChild().getNodeValue().equals("0")) {
    
                            arr[i][0] = sList.item(3).getFirstChild().getNodeValue();
                            arr[i][1] = sList.item(7).getFirstChild().getNodeValue();
                            arr[i][2] = sList.item(11).getFirstChild().getNodeValue();
    
                        }
                    }
                    conn=null;
                    docBuilderFactory = null;
                    docBuilder = null;
                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (ParserConfigurationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    
            return arr;
        }
    
        public static EncodedImage GetPngField(String pic) throws IOException {
    
            EncodedImage imageField = null;
            HttpConnection picon = null;
    
                picon = (HttpConnection) Connector.open(pic);
                picon.setRequestMethod(HttpConnection.GET);
    
            try {
                if (picon.getResponseCode() == HttpConnection.HTTP_OK) {
    
                    DataInputStream inputStream = picon.openDataInputStream();
                    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    
                    byte[] buffer = new byte[5120];
                    int len = 0, imageSize = 0;
    
                    while (-1 != (len = inputStream.read(buffer))) {
                        byteArrayOutputStream.write(buffer);
                        imageSize += len;
                    }
    
                    byteArrayOutputStream.flush();
                    picon.close();
                    picon=null;
                    byte[] imageData = byteArrayOutputStream.toByteArray();
                    byteArrayOutputStream.close();
                    byteArrayOutputStream = null;
                    inputStream = null;
                    //imageField = PNGEncodedImage.createEncodedImage(imageData, 0, imageSize);
                    EncodedImage pngImage = PNGEncodedImage.createEncodedImage(imageData, 0, imageSize);
                    imageField = resizeImage(pngImage,55,55);
    
                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    
            return imageField;
        }
    
        public static EncodedImage resizeImage (EncodedImage png,int Height, int Width) {
    
            int currHeight,currWidth,multH = 0,multW = 0;
    
            try {
    
                currHeight = png.getHeight();
                currWidth = png.getWidth();
                multH = Fixed32.div(Fixed32.toFP(currHeight),Fixed32.toFP(Height));
                multW = Fixed32.div(Fixed32.toFP(currWidth),Fixed32.toFP(Width));
    
            } catch (Exception e) {}
    
            return png.scaleImage32(multH,multW);
        }
    }
    

    I have

    hyoryeo wrote:

    Thanks ydarishy & peter_strange, I just point the programmer SR. is not recommended to use the wire in my workplace. But I think that the wire is the good way to make my faster program because I found that the wire would be used in many places in the Blackberry. Then I would practice the Thread in the test project.

    have been changes to the program and use the wire, saw the fastest forward speed. I would add the bar of charge process if necessary of the head. Thanks ydarishy & peter_strange,.

    SmartoneVodafoneServices.java

    import java.util.Vector;
    
    import net.rim.blackberry.api.browser.Browser;import net.rim.blackberry.api.browser.BrowserSession;import net.rim.device.api.servicebook.ServiceBook;import net.rim.device.api.servicebook.ServiceRecord;import net.rim.device.api.system.Characters;import net.rim.device.api.ui.Color;import net.rim.device.api.ui.DrawStyle;import net.rim.device.api.ui.Field;import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.container.HorizontalFieldManager;import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.ui.container.VerticalFieldManager;import net.rim.device.api.ui.decor.Background;import net.rim.device.api.ui.decor.BackgroundFactory;
    
    public class SmartoneVodafoneServices extends UiApplication {
    
       public static void main(String arg[]) throws Throwable {      SmartoneVodafoneServices application = null;      application = new SmartoneVodafoneServices();     application.enterEventDispatcher();   }
    
       public SmartoneVodafoneServices() throws Throwable {          pushScreen(new SmartoneVodafoneServicesScreen()); }}
    
    class SmartoneVodafoneServicesScreen extends MainScreen {
    
      private String url = "http://202.140.96.134:8080/Hero/shortcuts_demo.xml";
    
      private static ServiceBook sb = ServiceBook.getSB();  private static ServiceRecord[] records = sb.findRecordsByCid("BrowserConfig");    private HorizontalFieldManager mainHManager = new HorizontalFieldManager(Field.FIELD_VCENTER);    private VerticalFieldManager colum1 = new VerticalFieldManager(Field.FIELD_HCENTER);  private VerticalFieldManager colum2 = new VerticalFieldManager(Field.FIELD_HCENTER);  private VerticalFieldManager colum3 = new VerticalFieldManager(Field.FIELD_HCENTER);  private VerticalFieldManager colum4 = new VerticalFieldManager(Field.FIELD_HCENTER);  private VerticalFieldManager colum5 = new VerticalFieldManager(Field.FIELD_HCENTER);
    
        private Vector col = new Vector();
    
      public SmartoneVodafoneServicesScreen() throws Throwable {        super();      LabelField title = new LabelField("Smartone Vodafone Services",               DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.HCENTER);        setTitle(title);      col.addElement(colum1);col.addElement(colum2);col.addElement(colum3);col.addElement(colum4);col.addElement(colum5);       Background bg = BackgroundFactory.createSolidBackground(Color.BLACK);     getMainManager().setBackground(bg);       SmartoneVodafoneServicesScreen screen = this;     ConnectXMLThread startMainThread = new ConnectXMLThread(url,col,mainHManager, screen);        startMainThread.start();      //startMainThread.wait(30000);
    
      } 
    
      public BrowserSession createWAPBrowserSession()   {     // If there are browser services found - search for the WAP2      // Service Record     String uid = null;        int numRecords = records.length;      for( int i = 0; i < numRecords; i++ )      {         ServiceRecord myRecord = records[i];          if (myRecord.getUid().equals("WAP Browser Smartone")==true){              uid = myRecord.getUid();          }     }     return Browser.getSession(uid);   } public boolean keyChar(char key, int status, int time)       {         switch (key) {            case Characters.ESCAPE:                    System.exit(0);                   break;           }         return true;          //return true to indicate that a key was pressed      }}
    

    ConnectXMLThread.java

    import java.util.Vector;
    
    import javax.microedition.io.Connector;import javax.microedition.io.StreamConnection;
    
    import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.container.HorizontalFieldManager;import net.rim.device.api.ui.container.VerticalFieldManager;import net.rim.device.api.xml.parsers.DocumentBuilder;import net.rim.device.api.xml.parsers.DocumentBuilderFactory;
    
    import org.w3c.dom.Document;import org.w3c.dom.Node;import org.w3c.dom.NodeList;
    
    public class ConnectXMLThread extends Thread {
    
      private StreamConnection conn;    private Document doc; private Vector vector = new Vector(); private String url;   private Vector col;   private HorizontalFieldManager mainHManager;  private SmartoneVodafoneServicesScreen screen;
    
      //public ConnectXMLThread(long startApplication) {    public ConnectXMLThread(String url, Vector col, HorizontalFieldManager mainHManager, SmartoneVodafoneServicesScreen screen) {     // TODO Auto-generated constructor stub       //this.starttime = startApplication;      this.url = url;       this.col = col;       this.mainHManager = mainHManager;     this.screen = screen;
    
       }
    
       public void run() {       try {         conn = (StreamConnection) Connector.open(url);            DocumentBuilderFactory docFac = DocumentBuilderFactory.newInstance();         DocumentBuilder docBui = docFac.newDocumentBuilder();         doc = docBui.parse(conn.openInputStream());           NodeList list = doc.getElementsByTagName("item");
    
               for (int i = 0; i < list.getLength(); i++) {               Node nNode = list.item(i);                NodeList sList = nNode.getChildNodes();
    
                 if (sList.item(1).getFirstChild().getNodeValue().equals("0")) {                   String[] arr = new String[3];                 arr[0] = sList.item(3).getFirstChild().getNodeValue();                    arr[1] = sList.item(7).getFirstChild().getNodeValue();                    arr[2] = sList.item(11).getFirstChild().getNodeValue();                   vector.addElement(arr);               }         }         Vector threadList = new Vector(vector .size());           for (int i = 0; i < vector.size(); i++) {              String[] arr = (String[]) vector.elementAt(i);                String img = arr[1];              String url = arr[2];
    
                    ConnectPNGThread requestThread = new ConnectPNGThread(img, url, i,col,screen);                requestThread.start();
    
                  threadList.addElement(requestThread);
    
               }
    
               //System.out.println("Wait for threads to complete");         boolean isComplete = false;           while (!isComplete) {             // NetworkThread.sleep(500);              for (int i = 0; i < threadList.size(); i++) {                  if (((ConnectPNGThread) threadList.elementAt(i)).isAlive()) {                     isComplete = false;                       break;                    }                 if (i == threadList.size() - 1) {                     isComplete = true;                    }             }         }         //final long endApplication = System.currentTimeMillis();         UiApplication.getUiApplication().invokeLater(new Runnable() {             public void run() {                   for (int num = 0; num < 5; num++) {                        mainHManager.add((VerticalFieldManager) col.elementAt(num % 5));                  }                 screen.add(mainHManager);                 //Dialog.alert(Long.toString((endApplication - starttime)));              }         });
    
             System.out.println("All threads are complete");       } catch (Exception e) {
    
         }
    
       }
    
    }
    

    ConnectPNGThread

    import java.io.ByteArrayOutputStream;import java.io.DataInputStream;import java.util.Vector;
    
    import javax.microedition.io.Connector;import javax.microedition.io.StreamConnection;
    
    import net.rim.blackberry.api.browser.BrowserSession;import net.rim.device.api.system.EncodedImage;import net.rim.device.api.system.PNGEncodedImage;import net.rim.device.api.ui.Color;import net.rim.device.api.ui.Field;import net.rim.device.api.ui.Graphics;import net.rim.device.api.ui.component.BitmapField;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.container.VerticalFieldManager;
    
       public class ConnectPNGThread extends Thread {
    
          private StreamConnection picon;       private int p;        private Vector col;       private String img;       private String url;       private SmartoneVodafoneServicesScreen screen;
    
            public ConnectPNGThread(String img, String url, int i, Vector col, SmartoneVodafoneServicesScreen screen) {           // TODO Auto-generated constructor stub           super();          this.img = img;           this.url = url;           this.p = i%5;         this.col = col;           this.screen = screen;     }
    
         public void run() {       //public NetworkThread() {            try {             picon = (StreamConnection) Connector.open(img);               DataInputStream inputStream = picon.openDataInputStream();                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();                byte[] buffer = new byte[5120];               int len = 0, imageSize = 0;               while (-1 != (len = inputStream.read(buffer))) {                  byteArrayOutputStream.write(buffer);                  imageSize += len;             }             picon.close();                byteArrayOutputStream.flush();                byte[] imageData = byteArrayOutputStream.toByteArray();               final EncodedImage pngImage = PNGEncodedImage.createEncodedImage(imageData, 0, imageSize);                final BitmapField myBitmapField = new BitmapField(pngImage                        .getBitmap(), Field.FIELD_VCENTER | Field.FOCUSABLE) {                    protected boolean invokeAction(int status) {                      // BrowserSession site = Browser.getDefaultSession();                     BrowserSession site = screen.createWAPBrowserSession();                       site.displayPage(url);                        return true;                  }
    
                       protected void paint(Graphics g) {                        g.setBackgroundColor(Color.BLACK);                        g.drawRoundRect(0, 0, getWidth(), getHeight(), 10, 10);                       g.setColor(Color.WHITE);                      super.paint(g);
    
                     }
    
                   };
    
                  VerticalFieldManager c = (VerticalFieldManager) col.elementAt(p);             c.add(new LabelField(" ", LabelField.NON_FOCUSABLE));             c.add(myBitmapField);
    
                  } catch (Exception e) {               //e.printStackTrace();                System.out.println(e.toString());         }     }
    
        }
    
    
    

Maybe you are looking for