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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:44:39+00:00 2026-05-12T19:44:39+00:00

class Scr extends MainScreen { public Scr() { TableLayoutManager outerTable = new TableLayoutManager(new int[]

  • 0
class Scr extends MainScreen {

    public Scr() {

        TableLayoutManager outerTable = new TableLayoutManager(new int[]
                                                                      {
                             TableLayoutManager.USE_PREFERRED_SIZE,
                             TableLayoutManager.SPLIT_REMAINING_WIDTH
                            },0);
        TableLayoutManager innerTable = new TableLayoutManager(new int[]
                                                                       {
                                                                       TableLayoutManager. USE_PREFERRED_SIZE,
                                                                       TableLayoutManager.USE_PREFERRED_SIZE

                                                                       }, Manager.USE_ALL_WIDTH);

        innerTable.add(new LabelField("titleField"));
        innerTable.add(new LabelField("title"));
        innerTable.add(new LabelField("descriptionfield"));
        innerTable.add(new LabelField("description"));
        innerTable.add(new LabelField("rating field"));
        innerTable.add(new LabelField("***"));
        outerTable.add(new BitmapField(Bitmap.getBitmapResource("mac.png"),Field.FOCUSABLE));
        outerTable.add(innerTable);
        add(outerTable);

        outerTable.add(new BitmapField(Bitmap.getBitmapResource("fire.png"),Field.FOCUSABLE));
        outerTable.add(innerTable);
        add(outerTable);

    }

When I add another Bitmap and innerTable to the outerTable, and outerTable to the screen. The application gives a runtime jvm error 104
“Field added to a manager when it is already parented”.

The problem arises when I add another innerTable to outerTable. Not when I add Bitmap to outerTable.

  • 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-12T19:44:39+00:00Added an answer on May 12, 2026 at 7:44 pm

    innerTable has already been added to outerTable, you can’t add it a second time. this is because one instance of a control defines some member which tells where the control and how it displays, like the parent and size. those members obviously cannot have mumtiple values. so you have to create another control, which duplicate the first one, so that it can have its own parent and size.

    here, you have to create another instance of TableLayoutManager (maybe name it innerTable2) and add it to outerTable. also, outerTable is added 2 times, which will trigger the same error, you have to create another instance of outerTable.

    you should write: (note that there are better ways to do it…)

    public Scr() {
        TableLayoutManager outerTable = new TableLayoutManager(new int[]{
                             TableLayoutManager.USE_PREFERRED_SIZE,
                             TableLayoutManager.SPLIT_REMAINING_WIDTH
                            },0);
        TableLayoutManager outerTable2 = new TableLayoutManager(new int[]{
                             TableLayoutManager.USE_PREFERRED_SIZE,
                             TableLayoutManager.SPLIT_REMAINING_WIDTH
                            },0);
        TableLayoutManager innerTable = new TableLayoutManager(new int[]{
                             TableLayoutManager.USE_PREFERRED_SIZE,
                             TableLayoutManager.USE_PREFERRED_SIZE
                            },Manager.USE_ALL_WIDTH);
        TableLayoutManager innerTable2 = new TableLayoutManager(new int[]{
                             TableLayoutManager.USE_PREFERRED_SIZE,
                             TableLayoutManager.USE_PREFERRED_SIZE
                            },Manager.USE_ALL_WIDTH);
    
        innerTable.add(new LabelField("titleField"));
        innerTable.add(new LabelField("title"));
        innerTable.add(new LabelField("descriptionfield"));
        innerTable.add(new LabelField("description"));
        innerTable.add(new LabelField("rating field"));
        innerTable.add(new LabelField("***"));
        outerTable.add(new BitmapField(Bitmap.getBitmapResource("mac.png"),Field.FOCUSABLE));
        outerTable.add(innerTable);
        add(outerTable);
    
        innerTable2.add(new LabelField("titleField"));
        innerTable2.add(new LabelField("title"));
        innerTable2.add(new LabelField("descriptionfield"));
        innerTable2.add(new LabelField("description"));
        innerTable2.add(new LabelField("rating field"));
        innerTable2.add(new LabelField("***"));
        outerTable2.add(new BitmapField(Bitmap.getBitmapResource("fire.png"),Field.FOCUSABLE));
        outerTable2.add(innerTable2);
        add(outerTable2);
    }
    

    note that you have a lot of duplicate code here. you can factor the innerTable creation into a function which creates a TableLayoutManager, add all required labels and return the new configured TableLayoutManager.

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

Sidebar

Ask A Question

Stats

  • Questions 226k
  • Answers 226k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try this: select * from table where length(somefield) > 255;… May 13, 2026 at 1:11 am
  • Editorial Team
    Editorial Team added an answer It looks like you're mixing up JUnit 3 and 4… May 13, 2026 at 1:11 am
  • Editorial Team
    Editorial Team added an answer As DxCK siad the type that is passed to OperationContext.Current.GetCallbackChannel<T>()… May 13, 2026 at 1:11 am

Related Questions

I got error Access Violation when the following code is execute : void NoAction()
I have following code public interface IEntity { int Id { get; set; }
I have a jQuery autocomplete fild which gets existing data from my MVC action.
I have a web page which contains a select box. When I open a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.