Where server and port are JTextAreas holding the server and port, and configL is the label for the window. The label's set to "Save Successful.", but the file is blank after this runs. Can someone please tell me why?
EDIT 2: Above problem has been fixed. w.close(); Heh.
EDIT: configF is the JFrame holding all of this, and it should dissappear when I call configF.setVisible(false); but it doesn't. How should I go about making it dissappear?
10-20-2005, 09:52 PM
Could you post more code? setVisible(false) should work! Try adding a call to dispose().
10-20-2005, 10:36 PM
public JPanel createConfigPane()
final JPanel configPane = new JPanel(new GridBagLayout());
final JTextField server = new JTextField(serverIP);
final JTextField port = new JTextField(connPort);
I hit "Cancel", and I see "..Ehm, bye?" up on top, where the JLabel is, after I click the "Cancel" button.
10-21-2005, 11:19 AM
What is your question now?
Yes the button's actionlistener puts that text into the configL component.
10-22-2005, 06:56 PM
Well, yes. But that's AFTER I dispose of the frame, and AFTER I set it to be invisible.
It should be set, but I shouldn't be able to see it.
Question would be: "How do I make JFrames go away?"
10-22-2005, 09:56 PM
Cant' explain it. If what you've shown is being execture, setVisible(false) should make close the frame.
I can only guess that the code isn't executing as you think it is.
Add some println()s to see where it is executing and when.
10-23-2005, 01:46 PM
configF.setVisible(false); System.out.println("It should be invisible.");
configF.dispose(); System.out.println("It should be gone.");
It is printing out those two bolded lines, but the frame's still visible.
10-23-2005, 10:10 PM
Only looking at a small part of the program, its hard to say.
Does configF refer to the ONLY frame? Are there any others?
10-23-2005, 10:14 PM
There are a few other frames, else I would just call System.exit(0);. Generic "frame", which contains the main application frame. It's the only one "there" right now. The other frames are loginF, creditF, helpF, and charF, which are the login screen, credit screen, help screen, and characater creation screen, all uninitialized at this point.
createConfigPane() is called from a generic ActionListener set to a JButton, config, in the main "frame".