I'm just about to implement my first Java project and now at a point where I do not really get further.
The program is relatively simple. There is the possibility to create notes, which are displayed in a JList. You can change the notes, delete them and as a new feature, there should be a button to sort the notes within the JList ascending / descending by creation date.
The requirement for the implementation of the function, however, is the following: "According to the MVC principle I should not change the order of the objects inside my model, but only the entries in the JList". And that confuses me a little bit. I would have ordered the internal database with a Comperator or Decorate Pattern and then display the result, but that's not required. And now I am stuck. I always thought that the model is the basis for the view and that all the changes take place in the model.
As I said, I am a beginner and have searched even on Google and looked at several tutorials, but I lack the experience to know which approach is the right one and how to design the whole functionality. I think it has something to do with Listeners but I am not sure how to implement that. Thanks for your help!