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

  • SEARCH
  • Home
  • 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 8950641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:29:24+00:00 2026-06-15T13:29:24+00:00

I’ve made a small UI on Netbeans, and have am implementing the code in

  • 0

I’ve made a small UI on Netbeans, and have am implementing the code in a seperate class (Action Listeners etc.) I am trying to refresh the JTable with data stored in a MySql database, however I am getting this error when running the main class, the problem is not with the JDBC connection, that’s working fine, however it is not printing the data to the JTable.

Exception in thread "main" java.util.ConcurrentModificationException
at java.util.Hashtable$Enumerator.next(Hashtable.java:1031)
at com.sun.java.swing.plaf.nimbus.NimbusStyle.compileDefaults(NimbusStyle.java:378)
at com.sun.java.swing.plaf.nimbus.NimbusStyle.validate(NimbusStyle.java:297)
at com.sun.java.swing.plaf.nimbus.NimbusStyle.getValues(NimbusStyle.java:927)
at com.sun.java.swing.plaf.nimbus.NimbusStyle.getInsets(NimbusStyle.java:605)
at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:896)
at javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:275)
at javax.swing.plaf.synth.SynthLabelUI.updateStyle(SynthLabelUI.java:53)
at javax.swing.plaf.synth.SynthLabelUI.installDefaults(SynthLabelUI.java:48)
at javax.swing.plaf.basic.BasicLabelUI.installUI(BasicLabelUI.java:307)
at javax.swing.JComponent.setUI(JComponent.java:662)
at javax.swing.JLabel.setUI(JLabel.java:242)
at javax.swing.JLabel.updateUI(JLabel.java:256)
at javax.swing.table.DefaultTableCellRenderer.updateUI(DefaultTableCellRenderer.java:144)
at javax.swing.JLabel.<init>(JLabel.java:145)
at javax.swing.JLabel.<init>(JLabel.java:216)
at javax.swing.table.DefaultTableCellRenderer.<init>(DefaultTableCellRenderer.java:94)
at sun.swing.table.DefaultTableCellHeaderRenderer.<init>(DefaultTableCellHeaderRenderer.java:32)
at javax.swing.table.JTableHeader.createDefaultRenderer(JTableHeader.java:610)
at javax.swing.table.JTableHeader.initializeLocalVars(JTableHeader.java:632)
at javax.swing.table.JTableHeader.<init>(JTableHeader.java:138)
at javax.swing.JTable.createDefaultTableHeader(JTable.java:5586)
at javax.swing.JTable.initializeLocalVars(JTable.java:5520)
at javax.swing.JTable.<init>(JTable.java:614)
at javax.swing.JTable.<init>(JTable.java:540)
at AddressBookGui.initComponents(AddressBookGui.java:29)
at AddressBookGui.<init>(AddressBookGui.java:16)
at AddressBookImpl.refreshTable(AddressBookImpl.java:33)
at AddressBookImpl.startGUI(AddressBookImpl.java:26)
at AddressBookImpl.main(AddressBookImpl.java:16)

Edit: Yeah sorry here is the code that’s calling it, the actual GUI class is a generated one from Netbeans and I haven’t touched it, so unless it’s really necessary I’m not going to post that monster.

public class AddressBookImpl extends AddressBookGui implements ActionListener {

public static void main(String[] args) {
    AddressBookImpl impl = new AddressBookImpl();
    impl.startGUI();
    impl.listeners();
}

public void startGUI(){
    AddressBookGui gui = new AddressBookGui();
    gui.main(null);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    this.setResizable(true);
    this.setTitle("Address Book");
    refreshTable();

}

@SuppressWarnings({ "rawtypes", "unchecked" })

public DefaultTableModel refreshTable() {
    AddressBookGui gui = new AddressBookGui();
    try{

    DatabaseImpl dbi = new DatabaseImpl();
    dbi.refreshDatabase();
    DefaultTableModel defaultTableModel = new DefaultTableModel();
    ResultSetMetaData md = dbi.refreshResult.getMetaData();

    int columnCount = md.getColumnCount();

    while(dbi.refreshResult.next())
    {
        Object [] rowData = new Object [columnCount];
        for (int i = 0; i < columnCount; i++)
        {
            rowData[i] = dbi.refreshResult.getObject(i+1);
        }
        ((DefaultTableModel) gui.mainTable.getModel()).insertRow(dbi.refreshResult.getRow() -1, rowData);
    }

    defaultTableModel.fireTableDataChanged();

    return defaultTableModel;



    } catch (SQLException e) {
        e.printStackTrace();
    }
    return null;
}
  • 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-15T13:29:25+00:00Added an answer on June 15, 2026 at 1:29 pm

    at AddressBookImpl.main(AddressBookImpl.java:16) replace the current code by

    SwingUtilities.invokeLater( new Runnable(){
       @Override public void run(){ startGUI(); }});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have an array which has BIG numbers and small numbers in it. I
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.