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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:56:21+00:00 2026-05-12T11:56:21+00:00

I want a non-editable TextField (or a subclass) that doesn’t even have the caret

  • 0

I want a non-editable TextField (or a subclass) that doesn’t even have the caret displayed. Alternatively, I want a multiline LabelField. Is any of these possible?

  • 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-12T11:56:21+00:00Added an answer on May 12, 2026 at 11:56 am

    TextField without focus cursor

    TextField readOnly = new TextField(NON_FOCUSABLE);
    readOnly.setText("Read only, no carret");
    add(readOnly);
    

    TextField drawFocus override

    If text is too large to fit the screen, you can override drawFocus method in TextField, so scrolling will be available:

    TextField readOnly = new TextField(READONLY)
    {
        protected void drawFocus(Graphics graphics, boolean on) {}
    };
    

    TextFields, separated with NullFields

    Other option is to split TextField into several, separated with NullFields:

    class Scr extends MainScreen {
        public Scr() {
    
            String text = "Lorem ipsum dolor sit amet, consectetuer "
                    + "adipiscing elit, sed diam nonummy nibh euismod "
                    + "tincidunt ut laoreet dolore magna aliquam erat "
                    + "volutpat. Ut wisi enim ad minim veniam, quis "
                    + "nostrud exerci tation ullamcorper suscipit "
                    + "lobortis nisl ut aliquip ex ea commodo consequat. "
                    + "Duis autem vel eum iriure dolor in hendrerit in "
                    + "vulputate velit esse molestie consequat, vel "
                    + "illum dolore eu feugiat nulla facilisis at vero "
                    + "eros et accumsan et iusto odio dignissim qui "
                    + "blandit praesent luptatum zzril delenit augue "
                    + "duis dolore te feugait nulla facilisi.";
    
            text = addScrollText(text, 150);
        }
    
        private String addScrollText(String text, int partSize) {
            while (0 < text.length()) {
                int len = Math.min(partSize, text.length());
                TextField readOnly = new TextField(NON_FOCUSABLE);
                readOnly.setText(text.substring(0, len));
                add(readOnly);
                add(new NullField());
                text = text.substring(len);
            }
            return text;
        }
    }
    

    Multiline LabelField

    Multiline text in LabelField, just use newline escape character:

    String text = "first line \nnew line \nanother line";
    LabelField multiLine = new LabelField(text);
    add(multiLine);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery datepicker that I want to restrict non work days -
We have a server application that we want to restrict non-users from triggerring it
I want to make textfield non editable when application first time launched. And I
I want that when a non logged in user tries to access any controller
I want to make some sort of non-editable report view with images, titles and
I have a scrollable, non-ediable UITextView. I want to add a gesture recognizer to
I want to gray non-editable cell in JTable. I'm using such TableCellRenderer: TableColumn column
How to make a JTable non-editable? I don't want my users to be able
I want to modify the display of a (non-editable) JComboBox in such a fashion
I have a DataGridView with read-only mode set to true (non-editable) which takes values

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.