Hi, I am a new to programming with Java and I would like to know if there is some common practice for managing state of opened document (is current state saved or dirty) , saving document, opening, creating new document and so on. How do you approach this?
Right now I have my little Swing application and have actions for opening and closing document and creating new one, but I don't know how to manage if user has saved file or not (I need this to check if user wants to create new one or open existing while working on current.)
Is there some pattern for this? All advices are very welcome since I am still learning how to swim with Java.