Hi! Please take a look at the following code for a new user interface (that I plan to use sometime in the future). I've tied no events to any of the text fields or buttons. I'm mainly interested in your opinions in how I constructed the form itself.
I used several JPanels and 3 differnt Layout Managers to get my alignment set up. Is there a better way? Did I go over board on the Layout Managers?
This is pretty tough for someone that has only used VB to create desktop application interfaces.
Thanks for any observations you care to make.
Steve<br /> <br />No matter where you go, there you are.<br /> <br />"My evil self is at the door, and I have no power to stop it."
Unless you intend to include a "do you really want to quit" option, or similar, the window listener can be replaced by setDefaultCloseOperation(EXIT_ON_CLOSE);//in the constructor, or app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//in main()
1. tfPassword.requestFocus(); from the java api docs for requestFocus(): "Because the focus behavior of this method is platform-dependent, developers are strongly encouraged to use requestFocusInWindow when possible."
2. passWord = tfPassword.getText(); from the java api docs for getText(): "For security reasons, this method is deprecated. Use the * getPassword method instead."
the return value of getPassword() is a character array, which is easily convertable to a string - one of the string constructors accepts a character array as an argument.