• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Data doesn't show until I resize frame or click on table

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For some time now I thought that my data wasn't displaying because it wasn't getting process from the array properly. As it turns out, the data is there but won't display until I resize the frame or click on the table. I am firing the 'fireTableChanged(null)' event but this doesn't seem to be the problem. What is causing this?
Here is my method that is part of my AbstractTableModel.
public void loadTableData(Map Cycletally)
{
Collection entries = Cycletally.entrySet();
Iterator it = entries.iterator();
//data = new Vector();
String[] rowData;
int i = 0;
while(it.hasNext())
{
rowData = new String[2];
Map.Entry em = (Map.Entry)it.next();
rowData[0] = em.getKey().toString();
rowData[1] = em.getValue().toString();
data[i] = rowData;
i++;
}
fireTableChanged(null);
}
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
not all events are catched by the table automatically. call "fireTableDataChanged()", that should work.
if not, you might have some threading problem.
chantal
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic