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

  • SEARCH
  • Home
  • 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 6784727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:01:56+00:00 2026-05-26T17:01:56+00:00

I created one customUi class in that im creating 3 fiels as 1 label

  • 0

I created one customUi class in that im creating 3 fiels as 1 label and two button fileds….

so i m creating the customui and passing the filed names…

like

public class CustomTextField extends Manager {

    Field field ;
//passing 3 names to the construcor

protected void sublayout(int width, int height) {
        // TODO Auto-generated method stub

        int fieldCount = getFieldCount();
        int screenWidth = Display.getWidth();
        int yOffset =0;
        for(int i=0; i<fieldCount; i++)
        {

        field= getField(i);
        layoutChild(field, screenWidth, 100 );
        setPositionChild(field, (screenWidth-field.getWidth())>>1, yOffset);
        yOffset += field.getHeight()+5;
            }

        setExtent(screenWidth, yOffset);
    }

protected void paintBackground(Graphics g) {
        if(field.isFocus())
        {
        //g.setBackgroundColor(Color.ALICEBLUE);
        int oldColor = g.getColor();
        g.setColor(Color.DARKBLUE);
        g.drawRoundRect(0, 0, getWidth(), getHeight(), Graphics.ALL_ROUNDED_RECT_CORNERS, 60, 60);
        g.setColor(oldColor);
        }
    }
  • 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-05-26T17:01:56+00:00Added an answer on May 26, 2026 at 5:01 pm

    Don’t override paintBackground(Graphics g) inside of the manager. Override it inside of the child field class. It’s responsibility of a child field how to present its focused state.

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

Sidebar

Related Questions

I have created one class that directly map to ConfigSection of web. config. My
I have created one simple menu with two options that says Add new contact
I created one custom class & created object for that class. I want to
I created one linear layout and I have added two relative layout. I wish
I created one GWT webapplication project.Inthat i want to create servlet program,but in that
I created one sample phone app just dial a entered number like Intent callIntent
I created one module in Magento. I create Api.php in that. Now I want
I have created one application using XCode. Now i want to deploy that application
I have created one IPA file with right provision profile , after that i
I have created one play button using ButtonField on blackberry screen, if I click

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.