Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

help needed in Jtable using AbstractTableModel

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have predifined my 4 methods in my table class extends AbstractTableModel.
public int getColumnCount()
{
return getFieldInfo().length;
}
public int getRowCount()
{
return getRecordCount();
}
public String getColumnName(int col)
{
return getFieldInfo()[col].getName();
}

public Object getValueAt(int row, int col)
{
this is where i need help. I am having problem in figuring out how to convert my DataInfo[] obtained from criteriaFind() method...my search results...I would like to convert my DataInfo[] results into an Vector and to process the results and return the final values to my table.
}
Thanks alot Lisa.
 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lisa,
Have you checked what is available inside the data class? You can make use of the getValues() method to obtain an array of string of the record returned.
Rudy
 
Lisa Foster
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rudy I am making progress I took your advice and you are right again with getValues();
Thanks you have been a great help..
If anything this is a real learning experience.
Lisa
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic