I am creating a Java desktop application. In this application I have one table. If the user double clicks the row of table, the corresponding data was viewed in another window [frame -> view frame]. The user minimizes the view frame and selects another row in a table. It was again open in a new window [frame].
How to avoid the multiple frame? I want only one view frame at a time. Suppose the user want to view new data then the old view frame will exit and new view frame will open.
Make the frame an instance variable. Whenever you have to display a new frame, check if it is already displayed and if it is, first close the existing one and then display the new one.