Hi there,

I have this kind of sample table.

Name    Math    Science English
-------------------------------
Ben     86      88      80
Peter   80      79      83
John    84      90      86

I want to save this result, dynamically, in a "table" in Java. I want it to have a sorting function. Some of my user will like to view this by Name/Math/Science/English in ascending/descending order.

Also, I want to dynamically add data into this "table". Let's say like...
add("Albert", 81, 83, 81) will have a result of...

Name    Math    Science English
-------------------------------
Ben     86      88      80
Peter   80      79      83
John    84      90      86
Albert  81      83      81

I've read about ArrayList, ResultSet, DataTable, and many others but I really don't have any idea what's the right thing to use here. I'm also new to Java so please go easy on me. Just tell me if I'm missing some information to my problem.

Thanks.

Recommended Answers

All 4 Replies

Thanks for the link but I have to ask since I forgot to mention this.

Is this applicable for web applications (JSP)?

Ah, no, that's for Swing (local) graphical UI. I'm no expert on JSP, so someone else will have to answer that. Sorry. J

It's okay. But still, thanks! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.