Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

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

Posts: 28
  • Mark post as helpful
  • send pies
  • 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;
rowData = new String[2];
Map.Entry em = (Map.Entry);
rowData[0] = em.getKey().toString();
rowData[1] = em.getValue().toString();
data[i] = rowData;
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • 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.
Maybe he went home and went to bed. And took this tiny ad with him:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!