"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
luck, db
There are no new questions, but there may be new answers.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
But I can see some serious design problems in it:Rob Spoor wrote:That's not an SSCCE. . . .
Campbell Ritchie wrote:
But I can see some serious design problems in it:Rob Spoor wrote:That's not an SSCCE. . . .
Don't call the setDefaultCloseOperation method in a Listener. You should set that when the GUI is created, eg in the display's constructor or getUpGUI method. You have empty catch blocks. Those are dangerous because you never know whether an Exception has occurred. You have anonymous Listeners doing the same thing. You ought to create a DatabaseActionListener (or similar) class You also have long //comments inside code blocks, which I have changed because they make the code difficult to read. Your indentation is inconsistent, with "try" and the line following at the same level.
Campbell Ritchie wrote:So you have window 1 and something opens window 2? Does anything associated with window 1 retain a reference to window 2? I would be suspicious of your creating lots of secondary windows without some sort of link between them. Even so, you might find yourself having to add a WindowListener and dispose of all those windows in the closing or closed method. You would need WindowListeners on those secondary windows too . . .
The suggestion about using Dialogs sounds good. But one little thing about Dialogs; some of them are modal. You can find out more in the Java Tutorials.
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|