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

The Archive Base Latest Questions

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

I wrote a method, that creates my DefaultTableModel and there I’m going to add

  • 0

I wrote a method, that creates my DefaultTableModel and there I’m going to add my records.
When I set the model to my JTable, the data rows are blank. After scrolling the data gets displayed correct.

How can I avoid this and display the data from the first moment?

EDIT: I imported the javax.swing.table.DefaultTableModel –> is this correct?

private DefaultTableModel _dtm;

private void loadTable(Vector<Member> members) {
    loadTableModel();

    try {
        lbl_state.setText("Please wait");

        for (Member actMember : members) {
            String gender = "";
            if (actMember.getGender() == MemberView.MEMBER_MALE) {
                gender = "männlich";
            } else {
                gender = "weiblich";
            }

            _dtm.addRow(new Object[]{
                        actMember.getNname(),
                        actMember.getVname(),
                        actMember.getCity(),
                        actMember.getStreet(),
                        actMember.getPlz(),
                        actMember.getMail(),
                        actMember.getPhonenumber(),
                        actMember.getBirthdayString(),
                        actMember.getStartDateString(),
                        gender,
                        actMember.getBankname(),
                        actMember.getAccountnumber(),
                        actMember.getBanknumber(),
                        actMember.getGroup().toString(),
                        (actMember.hasAccess() ? "JA" : "NEIN"),
                        actMember.getWriteDateString(),
                        (actMember.hasDrinkAbo() ? "JA" : "NEIN")
                    });
        }
    } catch (Exception ex) {
        System.err.println(ex.getMessage());
    }

    tbl_results.setModel(_dtm);
}

private void loadTableModel() {
    _dtm = new DefaultTableModel(new Object[]{"Nachname",
                "Vorname",
                "Ort",
                "Straße",
                "PLZ",
                "E-Mail",
                "Telefon",
                "Geburtsdatum",
                "Beitrittsdatum",
                "Geschlecht",
                "Bankname",
                "Kontonummer",
                "Bankleitzahl",
                "Gruppe",
                "hat Zugriff",
                "Einschreibdatum",
                "Getränkeabo"}, 0);

    tbl_results.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
}
  • 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-13T22:11:09+00:00Added an answer on June 13, 2026 at 10:11 pm

    TABLE WAS INVISIBLE

    I checked every single line in my code, and it showed up that i set my table not visible.
    Only when I added the data and set it visibile. So I couldn’t see my data and select rows.

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

Sidebar

Related Questions

Possible Duplicate: Drawing multiple pixels/rectangles In my code i wrote a method that creates
I wrote a method that extracts fields from an object like this: private static
I have and old(ish) C# method I wrote that takes a number and converts
I wrote a windows service in C# that does some functionality (a public method)
Recently I wrote a suite of unit tests that relied on a large set
I just wrote a delegate method, that shall return an array, I've created inside
I'm trying to create a method that will add a node to my linked
I wrote a module that creates a cameraview overlayed with an imageView to shoot
I'd like to write a generic method that creates a new instances of a
Good evening all, I'm trying to write a method that creates and returns a

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.