1

recently I wrote a C# application, that simply rendered the elements of a list ( named lst) of objects into a table, with the following code:

DataTable dt = Request.ListToDataTable(lst);
dw = new DataView(dt);
dw.Sort = "columnb ASC";
dataGridView1.DataSource = dw;

now i need to do something similar in java : is it possible? or i have to create a tablemodel and working with it? Let's say I've a list of Person objects, and I want to build a table containing surname, name and age. Is it possible to do it in a smart way ?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
kaharas
  • 597
  • 2
  • 17
  • 39

2 Answers2

2

or i have to create a tablemodel

Yes you will need a custom TableModel.

You can use the Bean Table Model which allows you to create the model and the table in two lines of code.

camickr
  • 321,443
  • 19
  • 166
  • 288
1

It is certainly possible. The question is: what web framework are you going to chose? Most of them offer data binding on a proper model-view-controller concept.

Jochen Bedersdorfer
  • 4,093
  • 24
  • 26