posted 15 years ago
Hi
Some time ago, I've written this Code:
With that little proggie, you can sort some students by their name, lastname, id and grades but with no sorting options (no GUI), which means: after running the program,
5 entries will be printed on the console:
- All students (not sorted)
- All students (sorted by their name)
- All students (sorted by their lastname)
- All students (sorted by their ID)
- All students (sorted by their grades)
In the second version, you can now choose the sorting options (GUI => 4 JButtons). I didn't write that second version on my own, someone else did it for me
(for tutorial purposes). Here's the code:
Now, why am I posting in this forum: I'd like to have the sorting done only with arrays (array-sort, like I did in the first version) and not with lists and
collections (as it is done in the second version above).
I've already altered my own version of the code (first one posted) to match it better to the tutorial code. My new code consists of parts from my original code and
parts form the tutorial code. Here it is:
Unfortunately, I've encountered some problems:
- How do I get the Array-Sort-Methods working again (what do I have to change / write), so that it is possible to invoke them by pressing the corresponding JButton?
- How do I get the student2 variable working outside of the main-method? Declare it as final? But how...?
- How do i get rid off the remaining list-objects, so that it is (still) possible to run the program?
- Are there other things I have to change in my Code to make it work properly?
I hope you understand what I've written and can help me. English is not my native language.
Greeting
Learner