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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:13:13+00:00 2026-05-16T15:13:13+00:00

How can I add a textbox so a user can enter numeric values into

  • 0

alt text

How can I add a textbox so a user can enter numeric values into my form? I need the borders of the textbox control to be visible at all time.

Thanks.

  • 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-16T15:13:14+00:00Added an answer on May 16, 2026 at 3:13 pm

    You should implement your own class, inherited from TextBox and override void paint(Graphics g) method.

    Smth, like that, sorry i write from mobile:

    public void paint(Graphics g)
    {       
        // set color
        g.setColor(0x555555);
        // draw 100*100 rectangle 
        g.drawRect(0, 0, 100, 100);
        // dont forget to invoke 
        super.paint(g);
    }
    

    If you dont want use overriding,
    In OS 4.6+ you can use Border and BorderFactory classes (search in All Classes list).

    // Each integer represents the amount of space between the box and border
    // The four parameters of an XYEdge object represents each edge, 
    XYEdges thickPadding = new XYEdges(10, 10, 10, 10);
    
    // Sample text field with a thick and solid rounded border
    // and single solid colour background.
    RichTextField simpleField = new RichTextField("Solid rounded border, solid background");
    
    // Create border and background objects 
    Border roundedBorder = BorderFactory.createRoundedBorder(thickPadding, Border.STYLE_SOLID);
    
    // Set the objects for use
    simpleField.setBorder(roundedBorder);
    
    // Add the field to the screen
     add(simpleField);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create control that will allow user to design his own website
Okay I tried asking this question yesterday but i'm not sure if I gave
I have an iPhone app with a main view that has a UILabel and
I've built a new SharePoint 2010 Web Site. My authantication type is Claims Based
I have a JFrame with the JDesktopPane and inside the JDesktopPane, I launch with
A simplified scenario: I have a List<Foo> . Foo has two properties Description (
In order to take advantage of the spell checking ability of WPF textboxes, I
For some reason, this is happening very vaguely. Its working sometimes and sometimes it
I want to have a JTextField (or another text-like input which supports focus and
I have an inline popup that shows a list of checkboxes and associated labels

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.