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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:04:47+00:00 2026-06-11T22:04:47+00:00

i seem to have a rather peculiar issue with my overloaded constructors in the

  • 0

i seem to have a rather peculiar issue with my overloaded constructors

in the default constructor AutoFleetServicesMain()

i have

listModel = new DefaultListModel();
list = new JList(listModel);

and in the overloaded constructor AutoFleetServicesMain(int i)

i have

listModel.addElement(dbh.findAll());

according to my output, the default constructor is called before the overloaded one, so i see no reason why listModel is null

although if i add listModel = new DefaultListModel(); to the overloaded constructor, it will run without erroring but i still don’t get a list?

Any ideas for what i could do?

  • 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-11T22:04:49+00:00Added an answer on June 11, 2026 at 10:04 pm

    It sounds like you want to chain your constructors, but that doesn’t happen automatically. Try adding the following statement to the beginning of your AutoFleetServicesMain(int) constructor:

    this();
    

    This will call the default constructor before the subsequent logic. See this post for more examples of constructor chaining: How do I call one constructor from another in Java?

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

Sidebar

Related Questions

I have another Richfaces question which may seem rather weird. I am developing a
I seem to have an issue with somebody injecting code into the memory of
I have a rather small but weird problem that I can't seem to fix.
So I have a rather odd issue that I wanted to see if anyone
I seem to have a problem - rather unexpected; so I guess I might
I have rather simple, I imagine, question about CRTP , but I cannot seem
I have a rather confusing SQLite query that I can't seem to quite wrap
I seem to have a problem passing some strings on from one form to
I seem to have found a bug in jQuery UI that duplicates dragged elements
I seem to have hit a snag while building my project using Ant. 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.