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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:08:43+00:00 2026-06-05T12:08:43+00:00

Hi, I want to create a Login Screen which has a Username and Password

  • 0

enter image description here
Hi, I want to create a Login Screen which has a Username and Password
and a Sign in Button
But when a user fails to enter correct information inside the TextField of Username or Password a pop up like the image chat dialog should pop up from corner of TextField’s right side displaying appropriate message How can this Customization be achieved?

  • 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-05T12:08:45+00:00Added an answer on June 5, 2026 at 12:08 pm

    i am giving you a simple way. If it is not perfect to your question you just ignore this answer.

    Here i made logic like following. i gave you two buttons
    1)Login
    2)remove

    I think you know how to validate your text fields right or wrong; keep one if condition ,write your logic if right no need any field
    else wrong then you have three conditions

    1)id is wrong
    2)password is wrong
    or 3)both wrong

    according two that condition you can add particular tooltip box on above text field .

    I am providing sample for both wrong condition and remove condition also

    make it as your requirements

    Resources :

    chat.png image is required for background enter image description here

    Sample code:

    package mypackage;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    /**
     * A class extending the MainScreen class, which provides default standard
     * behavior for BlackBerry GUI applications.
     */
    public final class MyScreen extends MainScreen implements FieldChangeListener
    {
        /**
         * Creates a new MyScreen object
         */
        private BasicEditField id,password;
        private ButtonField login,cancel;
        private  VerticalFieldManager id_mgr,pass_mgr;
        private PopupField id_hint,pass_hint;
        public static Bitmap img;
        public MyScreen()
        { 
            img=Bitmap.getBitmapResource("chat.png");
            // Set the displayed title of the screen       
            setTitle("Login Page");
            Border b=BorderFactory.createRoundedBorder(new XYEdges(5, 5, 5, 5), Border.STYLE_SOLID);
            id_hint=new PopupField("Wrong Id", img);
    
            pass_hint=new PopupField("Wrong password", img);
            id_mgr=new VerticalFieldManager();
    
            id=new BasicEditField(){
                protected void layout(int width, int height) {
                    super.layout(120, 40);
                    setExtent(120, 40);
    
                }
            };
            id.setBorder(b);
            add(id_mgr);
            add(id);
            pass_mgr=new VerticalFieldManager();
            password=new BasicEditField(){
                protected void layout(int width, int height) {
                    super.layout(120, 40);
                    setExtent(120, 40);
    
                }
            };
            password.setBorder(b);
            add(pass_mgr);
            add(password);
    
    
    
            login=new ButtonField("Login");
            login.setChangeListener(this);
            add(login);
    
            cancel=new ButtonField("Remove");
            cancel.setChangeListener(this);
            add(cancel);
    
        }
        public void fieldChanged(Field field, int context) {
            if(field==login)
            {
                try {
    //              id_mgr.add(new NullField(Field.FOCUSABLE));
                    id_mgr.add(id_hint);
                    id_mgr.setPadding(0, 0, 0, 50);
                    pass_mgr.add(pass_hint);
                    pass_mgr.setPadding(0, 0, 0, 50);
                    id_hint.setFocus();
                } catch (IllegalStateException e) {
                    return;
                }
            }else if(cancel==field)
            {
                synchronized (UiApplication.getEventLock()) {
                    id_mgr.deleteAll();
                    pass_mgr.deleteAll();
                }
            }
    
        }
    }
    

    and class for PopupField.java is

    package mypackage;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.BitmapField;
    
    public class PopupField extends BitmapField{
        private  Bitmap img,scalled_img;
        private String message;
        private int layout_width;
    
        public PopupField(String message,Bitmap img)
        {
            this.message=message;
            layout_width=this.getFont().getAdvance(message)+40;
            scalled_img=new Bitmap(layout_width, img.getHeight());
            img.scaleInto(scalled_img, Bitmap.FILTER_BILINEAR);
            this.img=scalled_img;
        }
    
        protected void layout(int width, int height) {
    
            super.layout(img.getWidth(), img.getHeight());
            setExtent(img.getWidth(), img.getHeight());
    
        }
    
        protected void paint(Graphics graphics) {
            graphics.drawBitmap(0, 0, img.getWidth(), img.getHeight(), img,0,0);
            graphics.setColor(Color.RED);
            graphics.drawText(message,20,20);
            super.paint(graphics);
        }
    
    }
    

    output image :enter image description here

    keep helping to others

    Other solution is this link will tell you
    http://v4ks1n.wordpress.com/2011/01/28/tooltips-class-for-blackberry/

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

Sidebar

Related Questions

If on a login screen user submits a form with their username and password,
I want to create a Login-Screen in HTML where the user can fill out
I want to create login and password fields same as in facebook app for
Hi I want to create a WCF service that have login method, which is
I want create wordpress website into which I want create user management... That means
I am practising JSF. I created a login screen with user Id and password
i am new to smartGWT . i want to create auto login using j_security_check
I am new In ASP.NET, I want to create to Login Form using Membership
I want to create a simple login functionality in WP7 app using remote MySQL
How can I create my own login form on frontend? I don’t just want

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.