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

The Archive Base Latest Questions

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

I have a created a class that inherits from the Manager class that will

  • 0

I have a created a class that inherits from the Manager class that will act as a holder for four other abstract classes called AbstractColumn.

Imagine a table with 4 columns, the table itself is the main class, and each column is AbstractColumn.

I don’t understand why I would get this error.

Here are my classes.

The Main ColumnHolder.java class

package tec.expenses;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;




public class ColumnHolderManager extends Manager{

    private AbstractColumn Entry;
    private AbstractColumn Category;
    private AbstractColumn Date;
    private AbstractColumn Amount;

    protected ColumnHolderManager(long style){
        super(style);

        Background mainBackground = BackgroundFactory.createSolidBackground(0xEEEEEE);
        setBackground(mainBackground);

        AbstractColumn Entry = new AbstractColumn("Entry", NO_HORIZONTAL_SCROLL);
        AbstractColumn Category = new AbstractColumn("Category", NO_HORIZONTAL_SCROLL);
        AbstractColumn Date = new AbstractColumn("Date", NO_HORIZONTAL_SCROLL);
        AbstractColumn Amount = new AbstractColumn("Amount", NO_HORIZONTAL_SCROLL);

        add(Entry);
        add(Category);
        add(Date);
        add(Amount);        
    }

    protected void sublayout(int width, int height) {

        /*layoutChild(this.Entry, 85, 50);
        setPositionChild(this.Entry, 10, 10 );

        layoutChild(this.Category, 85, 50);
        setPositionChild(this.Category, 40, 0 );

        layoutChild(this.Date, 85, 50);
        setPositionChild(this.Date, 70, 0 );

        layoutChild(this.Amount, 85, 50);
        setPositionChild(this.Amount, 100, 0 );*/

        setExtent(360, 203);
    }

}

The abstract AbstractColumn class

package tec.expenses;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;


public class AbstractColumn extends Manager {
    LabelField labelHeader;

    protected AbstractColumn(String header, long style){
        super(style);

        Background mainBackground = BackgroundFactory.createSolidBackground(0xCACACA);
        setBackground(mainBackground);

        this.labelHeader = new LabelField(header);

        add(labelHeader);       
    }

    protected void sublayout(int width, int height) {

        layoutChild(labelHeader, 80, 30);
        setPositionChild(labelHeader, 5, 5);        

        setExtent(90, 50);
    }
}

As you can see the classes are very simple yet I cannot understand why I would get this error.

I’m making this application for Blackberry using Eclipse as the IDE.

When I comment out the Sublayout methods’ setPositionChild methods I no longer get the exception which means that in the constructor of the ColumnHolderManager class, creating the new AbstractColumn objects aren’t really getting created.

Any help?

  • 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-16T20:13:09+00:00Added an answer on May 16, 2026 at 8:13 pm

    In these lines:

    AbstractColumn Entry = new AbstractColumn("Entry", NO_HORIZONTAL_SCROLL);
    AbstractColumn Category = new AbstractColumn("Category", NO_HORIZONTAL_SCROLL);
    AbstractColumn Date = new AbstractColumn("Date", NO_HORIZONTAL_SCROLL);
    AbstractColumn Amount = new AbstractColumn("Amount", NO_HORIZONTAL_SCROLL);
    

    you are creating and initializing local variables.

    You want to be initializing your instance members. Like this:

    Entry = new AbstractColumn("Entry", NO_HORIZONTAL_SCROLL);
    Category = new AbstractColumn("Category", NO_HORIZONTAL_SCROLL);
    Date = new AbstractColumn("Date", NO_HORIZONTAL_SCROLL);
    Amount = new AbstractColumn("Amount", NO_HORIZONTAL_SCROLL);
    

    Also, normal Java code style rules indicate that your members should start with a lower case letter: entry, category, date, amount.

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

Sidebar

Related Questions

I have a collection of classes that inherit from an abstract class I created.
I have a control that is created like so: public partial class MYControl :
I have created a class for a dashboard item which will hold information such
I have created UITableCellView class called NoteCell . The header defines the following: #import
I have a class that creates several IDisposable objects, all of these objects are
I have a PHP class that creates a PNG image on the fly and
I have a class Page that creates an instance of DB , which is
I have created a class library in VB .NET. Some code in the library
I have created a C# class file by using a XSD-file as an input.
in my data layer class I have created a function to manually refresh the

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.