Problem to get the background color

Mr President, in my code, I wasn't able to use fully all the width of the screen,

This is my code

public class HorizontalField extends VerticalFieldManager
{
   HorizontalFieldManager sd=new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);
   HorizontalFieldManager r1=new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);
   MySeparatorField ds=new MySeparatorField();
   Font fnt,fntv;
    HorizontalField()
    {
       fnt = this.getFont().derive(FontFamily.SCALABLE_FONT, 14);
       fntv = this.getFont().derive(FontFamily.SCALABLE_FONT, 11);
       r1.setFont(fntv);
       /*---------------------Heading-----------------------------------*/
       DateField dd=new DateField("Date");

       dd.setFont(fnt);
       sd.add(dd);
      /*------------------*/
       MyLine s=new MyLine();
       sd.add(s);
       Desp d1=new Desp("Description");
       d1.setFont(fnt);
       sd.add(d1);      

       /*_________________*/
       MyLine s1=new MyLine();
       sd.add(s1);

       Amt d2=new Amt("Amount");
       d2.setFont(fnt);
       sd.add(d2);
       add(new SeparatorField());
       add(sd);
       add(new SeparatorField());

           DateField dfr=new DateField("13.08.09")
           {
               public void paint(Graphics g)
               {
                    g.setBackgroundColor(Color.RED);
                    g.clear();
                    super.paint(g);
               }
           };
           r1.add(dfr);
           MyLine sr=new MyLine();
           r1.add(sr);
           Desp dr=new Desp("Reent")
           {
               public void paint(Graphics g)
               {
                    g.setBackgroundColor(Color.RED);
                    g.clear();
                    super.paint(g);
               }
           };
           r1.add(dr);
           MyLine sra=new MyLine();
           r1.add(sra);
           Amt amtr=new Amt("5000")
             {
               public void paint(Graphics g)
               {
                    g.setBackgroundColor(Color.RED);
                    g.clear();
                    super.paint(g);
               }
           };
           r1.add(amtr);
           add(r1);
           add(new SeparatorField());

       }

    }

 class DateField extends LabelField
{
     DateField(String s)
    {
        super(s,LabelField.LEFT);
     }
    public  int getPreferredWidth()
    {
        return Display.getWidth()*2/10;
    }

}

  class Desp extends LabelField
{
     Desp(String s)
    {
        super(s,LabelField.RIGHT);
     }
    public  int getPreferredWidth()
    {
        return Display.getWidth()*5/10;
    }

}

  class Amt extends LabelField
{
    Amt(String s)
    {
        super(s,LabelField.RIGHT);
     }
    public  int getPreferredWidth()
    {
        return Display.getWidth()*4/10;
    }

}

MyLine code is

public class MyLine extends LabelField
{
    int width,height;

    ButtonField dd;
    MyLine()
    {
        width=1;
        //height=200;
    }
     MyLine(int w)
    {
        width=w;
        //height=200;
    }

     public int getPreferredWidth()
        {
            return width;
         }

     public void paint(Graphics g)
            {
                   // g.setBackgroundColor(Color.BLUE);

                 g.drawLine(0,0,0,70);
            }
}

When I call this HorizontalField I get the result, but in the amount column (i.e. red) background color I get half of this label, I don't know what problem I did

Thank you

The problem is in your calculation of width.

Your should calculate your width in such a way that (approximate):

Display.getWidth () = DateField width, width PED, Amt width + 2 * MyLine width;

Furthermore, a solution may be simply change your constructor Amt class as below:

        Amt(String s)        {                   super(s,LabelField.RIGHT | Field.USE_ALL_WIDTH);        }

Concerning

Bika

Tags: BlackBerry Developers

Similar Questions

  • How to get the background color of a layer with AE SDK

    Hello

    I try to get the background color for my current layer, but I can't seem to find how do.

    I don't want background color, background color of the application, but the color that shows through, if I set the alpha of my pixels to 0.

    For example, assume that the background of the composition is black, I put a solid top, green then put a picture on top of the solid and apply my pug-in the image.

    If I set the alpha to zero in my plug-in, green solid will be displayed.

    So I want to be able to know that my background is green.

    I tried to use PF_AppGetBgColor(), but which returns the background color of the application, which isn't green in this example.

    If you want more details on what I want to do, I plug P1 which affects some 0-alpha pixels. Above it, I apply an another plugin P2 which reveals alpha-0 pixels by mixing with little color.

    What is happening now is that the output is color of the original image, mixed with the color of P2 (because only modified P1 alpha pixels).

    What I want is to have the color through the transparent pixels of P1 display mixed with the color of P2.

    To do this, I would like to be able to set the color of pixels 0-alpha in the color of the background in P1.

    Sorry for the question long.

    Thanks for your suggestions.

    Hello nicolas.

    If I understand it, that you try to get the buffer of image layers composited under the layer with your effect.

    If that is correct, then I fear that it is almost impossible to do.

    When AE makes a composition he doesn't it down. He's trying to do the opposite in fact.

    Why? because if at some point, the buffer is completely opaque, then he has no need to make what's below.

    further more, checked the diaper changing the rendering order, and many other things affect the rendering of the layers order.

    In addition, there is no API to access buffers intermediaries comp. just the end result.

    the closest you can get than without turning of the world, is to use AEGP_GetCompBGColor().

    that would be useless to you that the image is not composite on that color, unless it is the model being saved to the file.

    so why I said 'almost impossible '?

    You can transform the world.

    You can write a type ECAP 'craftsman '. (look at the example of 'arti')

    These plug-ins make comps (instead of the "advanced3D" converter)

    a craftsman has results intermediaries comp, because he is the one doing the rendering.

    so now you can have your craftsman save the buffer, you need and deliver it to your effect.

    I must warn you that this is very very very difficult.

    Another possible solution is to create a copy of the model resides in your effect,

    erase all the layers that has the image you need and make that reproduces model using AEGP_GetReceiptWorld().

    If you use this method, you must supervise the original model and apply changes to the copy.

    Yes, it's too difficult to do.

    you could make a change in the strategy and apply your effect to an adjustment layer instead.

    the entry for the adjustment layer is the buffer underlying layers.

    Then, you could get the original sources you want to treat using checked layer params.

    the last solution I can think uses the expression of sampleImage() on a hidden parameter.

    This will give you any layer's pixel data in the model, but not the composite of the underlying layers.

    Maybe if you tried sampling adjustment layers post effects... I don't know. you need to try.

    This method is very slow and is also limited to expire, so you can't get a large number of pixels.

    the expression simply fails.

    I hope that this was not all bad news for you.

    Maybe you said more about the plug-in you develop I could come up with a better plan.

    :-)

  • 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!
  • Active window color problem - cannot change the background color

    original title: Active window color problem

    By right-clicking: Desktop, then click on: personalization / window color and appearance / settings (Advanced) appearance, Windows user can assign a background color of the active window in any application.  This is useful for those of us who don't want a stark white screen; We can assign a mild pastel tint which may be easier on the eyes for long term sessions.

    At some recent point, I lost the background color of the active window within Windows uses 'household.  I still not my background color assigned in any application I run (Word, Mail, etc.), but using Windows Explorer to navigate through my hard drive, the active window is now always the default stark white Windows.  How this change and can it be forced to adhere to the assigned active window background color?

    Hello

    Step 1: Check if the problem continues in a new user account.

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-a-user-account

    Step 2: If the problem does not persist in a new user account, then the old profile could have been corrupted. Try the following article to fix a corrupted user profile.

    http://Windows.Microsoft.com/en-us/Windows-Vista/fix-a-corrupted-user-profile

  • FrameMaker10 - Windows 7 - How to get the background color of a paragraph tag?

    2-27-2013 1-38-39 PM.png

    I'm trying to create my heading1 with a background like the picture above.

    I put the blue background on a master page, but the chassis will in the background blue and later blue background does not show through.

    Any ideas?

    Thank you

    Cindy

    Cindy,

    You must create a specific master page for the opening/first chapter page that contains two connected text frames. The most senior executive would have the blue background and be served for the title. The following text block would get the text and have two columns.

  • How can I get the background color behind a desktop icon to disappear leaving only the descriptive text

    I want that my descriptive text of the icon on the desktop without a "shade of the color of the desktop setting out the text block.

    I want that my descriptive text of the icon on the desktop without a "shade of the color of the desktop setting out the text block.

    =============================
    This happens usually when you use wallpaper...

    Try the following steps to avoid what he...

    Right-click the icon of your desktop and choose...
    Properties / Advanced tab / Performance - Settings button...

    I'm guessing that you have 'Adjust for best performance' selected...

    Just scroll down and check the box...
    'Use the shadows of the desktop icon labels' / apply / OK / OK John Inzer - MS - MVP - Digital Media Experience

  • Problem by setting the background color of a Manager

    Hello

    I have a Manager (chatManager), he has another Manager (chatmsgMngr) in it. chatManager has 2 bars and chatMsgMngr. chat messages are added in chatMsgMngr as chat messages arrived. I want the entire screen to be black. I put the bottom of the chatmsgMngr and chatManager in the dark. Code is this:

    public ChatManager() {
      super();
      init();
      this.setBackground(BackgroundFactory.createSolidBackground(Color.BLACK));
    }
    
    private void init() {
       .....
       rightBorder = BorderFactory.createBitmapBorder( new XYEdges( 2, 2, 12, 20 ), Bitmap.getBitmapResource( "res/bubble-right.png" ) );
       leftBorder = BorderFactory.createBitmapBorder( new XYEdges( 2, 2, 12, 20 ), Bitmap.getBitmapResource( "res/bubble-left.png" ) );
    
            chatMsgMngr = new ChatMessageManager(Common.displayWidth, Display.getHeight(), VERTICAL_SCROLL | VERTICAL_SCROLLBAR);
            chatMsgMngr.setBackground(BackgroundFactory.createSolidBackground(Color.BLACK));
            addMessage("Hi from Me !", leftBorder, Field.FIELD_LEFT );
    
        add(chatMsgMngr);
    }
    

    Initially, "Hi me!" message. A part of the screen is black, left is white only. Why is this?

    Any guidance?

    Thank you

    Resolved, please ignore.

    Thank you

  • How can I change the background color under Windows 7 64-bit

    How to get the background color of the screen to change.  I went through the customization of themes and custom colors that changed some screens, but not all.  I've recently updated to XP and I find it frustrating.  For example, when you use ITunes, my desktop background is white which is difficult to focus on for long periods of time.  On my XP machine, I was able to change the background of a light gray.  Help, please.

    In fact it's not Windows, it's iTunes.  The latest version is very white (and very hard on the eyes).  It seems just as bad on XP, you probably just the previous version of iTunes before you upgrade.  Unfortunately, Apple is the only one who can change - it program iTunes, and they do not meet the standard rules of "respect the choice of the users!

    If this was helpful, please vote. If it solves the problem, please click on propose as answer. Thank you!

  • How can I get larger fonts and change the background color in Outlook Express, a light blue to improve my vision

    original title: vision problems.  How can I get bigger fonts in incoming messages on Outlook Express?  How can I change the background color in Outlook Express for a light blue to improve my vision of the messages.e

    I have problems with my vision.  How the larger font for messages in Outlook Express so that I can see them?  Also how can I make the background is easier on my eyes.  As a light blue or something.  Thank you.

    You can change the font size of incoming emails by going to the Tools menu in Outlook Express and selecting Options.  Open the read tab, and then click the fonts option.  In the fonts window, click on font size and make your selection.  I always click OK, then apply and OK to be sure change stick.  You may close OE and then reopen it for the change to take effect.

    I don't know of any way to change the background color of the e-mails received.  I'm sure someone will have an answer for this procedure.

    Rosie
    Dell OptiPlex GX260, 2.40 GHZ, Pentium 4, 80G HD, Windows XP Pro (SP3), IE8, Avira, Spybot S & D, SpywareBlaster 4.2, 4.0 OnlineArmor

  • Problem with the background color of a disabled control

    I have a few controls on the top a box colored and elevated. When I disable and gray (round button) control an adverse change occurs in the background color of the control-it gets surrounded by a grey version of the color of the raised area. I would like that the bottom remains the same as it does on the default gray Panel.

    I looked through all of the properties, but can't seem to change this behavior.

    Thanks for the link, looks that it may have been fixed now for controls tab (?) but no decorations. The solution is to use a tab control to single page with no tab, rather than a raised area. The difference in behavior can be seen in the joint, if we look carefully it is always a small amount of color change surrounding control disabled on the tab.

  • How can I get rid of the background color in shortdesc

    Whenever I have delete the background color of the short.description paragraph tag, it comes at the time when I reopen FrameMaker. I don't want the background colors in my short descriptions.

    Hello

    As Scott pointed out, you make changes in the model if you want to remove the background color in shortdesc. If you create a topic / / concept/glossentry/reference tasks, etc., the models are found here:

    C:\Program Files\Adobe\AdobeFrameMaker10\structure\xml\DITA_1.2\app\technicalContent\template (in Windows XP)

    Note: Please take a backup of your original models, just in case where something goes wrong here.

    (1) assuming you create a theme, open topic.template.fm.

    (2) paragraph open designer. Format > paragraphs > Designer...

    (3) ' short.description' select the tag in the menu drop-down.

    (4) Goto the tab "Default font" in the paragraph Designer.

    (5) at the bottom of this dialog box, check "Background color".

    (6) click on the "Update All" button

    (7) save the document template.

    This should help you to get 'RID' of the background color in shortdesc.

    Kind regards

    Saurabh

    Team Adobe FrameMaker

  • How to set the background colors of different message by account?

    I have two email accounts (let's say a private one for companies) in Thunderbird. Sometimes I (wrongly) mail on the wrong account. That is, I read some messages in a single account, followed by reading in the other account. I hit 'empty' to send a message and be sure to make sure I'm in the right account, that I want to mail to. Every now and then post to the wrong account, get the name wrong 'sender' and I ' answer to "name of the message.

    I looked at the account settings and found I can change the background color (in the e-mails triggered and and sent in the mail while composing). I changed the background color in a SINGLE account (in light yellow) and expects the other account be unchanged (white). Not the case. Change the background color in the account for a single account settings changes the color in all accounts (both).

    It is unexpected and unwanted, and my problem is still there.

    There is an add-on that accounts of color coding and records:

    https://addons.Mozilla.org/en-us/Thunderbird/addon/account-colors/

    and also the modules allowing to choose the correct identity:

    https://addons.Mozilla.org/en-us/Thunderbird/addon/identity-Chooser/

    https://addons.Mozilla.org/en-us/Thunderbird/addon/correct-identity/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

  • Stop the background color printing on e-mail using Windows Mail

    I have asked this question before and was advised. [When I tried to find the answer, I got:' bughttps://bugzilla.mozilla.org/show_bug.cgi?id=683139 683139]-using the ' high contrast black ""Accessibility Option"Win XP results in the colors of the screen printing", I discovered there was no such bug by this number. Now I think that somewhere in Mozilla there is a simple and complete answer that would solve the problem that I, and several others are apparently seen. So, here is again - when I get and want to print it, the background color that I have on my Windows Mail page prints also. That I don't want. I want to email to print with no background color to everything to save on color ink. It is not flattering that I get an email from my background color is printed when I print the email. So, I need to know how to prevent that from happening?

    Another thread is here - https://support.mozilla.org/en-US/questions/912736 - why did you mark it as resolved and then start another thread?

    https://Bugzilla.Mozilla.org/show_bug.cgi?id=683139

    This bug exists and a fix we talked until the discussion has been hijacked. Not yet fixed, so turn off the high contrast in Windows text looks like the way to avoid this issue for now. Or use another browser to print from Windows Mail for now.

  • 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

  • I can't access the screen reader and if I can change the background color?

    Can someone tell me please how to get Adobe Reader to read aloud?  Thank you

    Hi Elizabeth,.

    To use read out loud, please open Adobe Reader.

    Go to the View Menu, select 'Read Out Loud' and then 'activate read out loud.

    Once back on, go to the view menu-> read aloud & select the option desired (read this page only or read at the end of the Document).

    To change the background color of your document, please go to the Edit-> Preferences menu.

    Categories choose accessibility & check replace color Document.

    Now select the color of the text page background & document.

    Click OK to confirm the changes.

    Let me know if you encounter any problem.

    Kind regards

    Nicos

Maybe you are looking for

  • Display driver for W2k for Satellite L20-112

    Hello! I am looking for a display driver for the Satellite L20 - 112 for Windows 2000. Can someone help me please. I'm looking for the driver for a long time. I have the ATI Radeon Xpress 200 M. I downloaded the Catalysp 5.13, but he insists that 'No

  • problem with magic network after the recent windows and mcafee updates

    There seems to be a conflict with of cicso latest windows and mcafee updates Network Magic platform. Hard to say which is originally the closing down due to the fact they both tend to update together or to the one right after the other. Could someone

  • change the display of the wide screen to normal

    my laptop screen is very wide viewing.  I don't know if I pressed a button, but everything is great, as if it were the safe mode.  How can I change this back to normal?

  • Analysis of C++ JSON

    Given the following JSON [ { "id":1, "firstname": "Mike", "lastname": "Chepesky", "title": "Sr. Editor", "image": "images/data/mike_chepesky.png", "active": true, "gender": "m" }, { "id":2, "firstname": "Westlee", "lastname": "Barichak", "title": "Ta

  • Visitors to hotmail

    Does anyone if emails saying that you need to update your account by providing your name, your date of birth AND your password for your account MORE a different e-mail address and password? I sent an email back and asked them to send me the informati