• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question on a design

 
Ranch Hand
Posts: 51
Hibernate Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I'm a greenhorn to OOPs and Jave language but not to programing.
I have a question on a design of an application. I works but is there a better way.
My application is for creating and maintaining a class roster.
There is no database just reading and writing to a text file.
It has a collection(arraylist) called members of a class called member that holds name, address and Id.
I read from the text file and create members collection but to edit it I when with a jTable.
So I convert the collection to Object[][], display the jTable and when a
Save button is pressed I update the collection with the Object[][] data. then write the data back to the text file.
There are a lot of steps in doing the converting from the collection to Object[][] and back again,
so I was wondering if there is a better way.
Thanks
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the OO design, UML and refactoring forum
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could implement your own TableModel, directly accessing the Collection.
 
Gene Hilpert
Ranch Hand
Posts: 51
Hibernate Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks - I kept thinking theres got to be a simpler way.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic