Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8968269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:25:52+00:00 2026-06-15T17:25:52+00:00

I have a VerticalFieldManager that renders a white round rectangle. This is the code:

  • 0

I have a VerticalFieldManager that renders a white round rectangle.

This is the code:

 VerticalFieldManager _vfmBackground = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | 
                Manager.NO_VERTICAL_SCROLLBAR | Manager.USE_ALL_WIDTH){
             public void paint(Graphics graphics)
                {
                    graphics.clear();
                    graphics.setColor(Color.WHITE);
                    graphics.fillRoundRect(10, 10,460, 400, 25,25 );
                    super.paint(graphics);
                }

              protected void sublayout(int maxWidth, int maxHeight)
                {
                    int displayWidth = (Display.getWidth());
                    int displayHeight = (Display.getHeight());

                    super.sublayout( displayWidth, displayHeight);
                    setExtent( displayWidth, displayHeight);
                }

        };

Then I create a custom Manager class named BaseHeaderBlueScreen that renders a blue rectangle:

public void paint(Graphics graphics)
    {
     graphics.clear();
     graphics.setColor(610212);
     graphics.fillRect(20, 0, Display.getWidth(), Display.getHeight());
     super.paint(graphics);
    }

    protected void sublayout(int maxWidth, int maxHeight)
    {
        int displayWidth = (Display.getWidth()-40);
        int displayHeight = ((Display.getHeight()/2))-90;

        super.setExtent( displayWidth, displayHeight);
    }   

Finally, I add that custom manager to the VerticalFieldManager with the white rounded rectangle:

BaseHeaderBlueScreen _vhbs = new BaseHeaderBlueScreen(textTop, textBottom, 0);
        _vhbs.setPadding(20,30,0,0);
        _vfmBackground.add(_vhbs);

This is how the blue rectangle should be displayed within the white rectangle.

enter image description here

But this is how the blue rectangle is currently being displayed (please note the gray space of its left side):

enter image description here

How should I do to render the blue rectangle exactly as desired (without the left gray border)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:25:53+00:00Added an answer on June 15, 2026 at 5:25 pm

    I think you’re just unnecessarily making a call to Graphics.clear(). clear() is meant to fill in the graphics area with whatever color is currently set as the background color. Normally, you would use clear() like this:

    public void paint(Graphics g) {
        g.setBackgroundColor(Color.GRAY);
        // calling clear makes the background gray
        g.clear();
    
        // now draw some text
        g.setColor(Color.WHITE);
        g.drawText("hello", 20, 40);
    }
    

    From the API docs for clear():

    Clears the entire graphics area to the current background color. Note that global alpha is not applied in this case.

    But, you’re calling clear() before you make any other calls.

    So, just remove the two calls to clear() (although the one that’s causing this particular problem is the call in BaseHeaderBlueScreen.paint()).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an verticalFieldManager as shown in fig. and in this manager I have
Have some code: using (var ctx = new testDataContext()) { var options = new
I am using this code to set the scrollBar to the VerticalFieldManager in Blackberry
have a php code like this,going to convert it in to C#. function isValid($n){
Have converted devise new session from erb to Haml but doens't work, this is
Have a look at this code: #include <iostream> using namespace std; int main() {
have this code import threading def Thread(f): def decorator(*args,**kargs): print(args) thread = threading.Thread(target=f, args=args)
I have a custom extension of VerticalFieldManager that automatically scrolls itself to display data
I have a created a class that inherits from the Manager class that will
How to draw focus to a VerticalFieldManager in BlackBerry. I have tried this but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.