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 7578305
In Process

The Archive Base Latest Questions

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

I have used EditField with some specified width and height that works good but,

  • 0

I have used EditField with some specified width and height that works good but, when I’m entering the text in EditField I’m unable to see the text and some times when I’m clicking on that I’m getting NullPointerException. I’m not able to understand whether the text is entered or not. Also, I cannot see the cursor in my field. If there are any mistakes please give me suggestions.

My code is:

       private EditField edto;
       private int tosetWidth =400 ,tosetHeight = 50;
       public WelcomeScreen()
       {
           /* Border For EditFields */
           Border bdr = BorderFactory.createRoundedBorder(new XYEdges(4, 4, 4, 4),Border.STYLE_SOLID);

           edto = new EditField(){

           protected void layout(int width, int height)
           {        
               setExtent(tosetWidth, tosetHeight);

           }

       };

       edto.setBorder(bdr);
  • 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-30T17:24:02+00:00Added an answer on May 30, 2026 at 5:24 pm

    Text not showing because of this

    protected void layout(int width, int height)
            {        
                setExtent(tosetWidth, tosetHeight);
    
            }
    

    just remove and try your code is working

    if you want to edit field with vertical scrolling and fixed size try following

    /**
     * A class extending the MainScreen class, which provides default standard
     * behavior for BlackBerry GUI applications.
     */
    public final class MyScreen extends MainScreen
    {
        /**
         * Creates a new MyScreen object
         */
        public MyScreen()
        {        
            // Set the displayed title of the screen       
            setTitle("My Edit box Example");
    
            VerticalFieldManager vr=new VerticalFieldManager(VERTICAL_SCROLL|VERTICAL_SCROLLBAR)
            {
                protected void sublayout(int maxWidth, int maxHeight) {
                    super.sublayout(200,100);
                    setExtent(200, 100);
                }
            };
    
            Border bdr = BorderFactory.createRoundedBorder(new XYEdges(4, 4, 4, 4),Border.STYLE_SOLID);
            EditField edto = new EditField(){
                public void paint(Graphics g) 
                {
                    getManager().invalidate();
                    super.paint(g);
                }
         };
    
         vr.setBorder(bdr);
         vr.add(edto);
         add(vr);
         }
    }
    

    you can get output as following

    enter image description here

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

Sidebar

Related Questions

I have used 3 some jquery related files namely <script type=text/javascript src=/blog/jquery/jquery-1.7.1.min.js></script> <link type=text/css
We have used Custom List View inside that one Text View and two Edit
I have used some TCL, but this construction stumps me. When $res = Table
I have used checkbox column in gridview. I want to check status of that
I have used microsoft system.security.cryptography to make md5 in c# application but I need
I have used following code to add three variables but instead of adding these
I have used ajax in the code which works perfectly and give me json
I have used initialization lists a great deal in my C++ programs but wasn't
i have used filter to get the gradient and border-radius for round border but
I have used Broadcast receiver when it restarts it shows the launcher screen 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.