Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Making a JTextArea appear/disappear

807607Nov 23 2006 — edited Nov 24 2006
I have:
JFrame frame;
JComponent screen;
JTextField chatbox;

Container pane = frame.getContentPane();
pane.add(screen,BorderLayout.CENTER);
pane.add(chatbox,BorderLayout.SOUTH);
The screen draws the graphics and I want the chatbox to pop up at the bottom whenever the user presses enter.

I originally call chatbox.setVisible(false) during the initialization. But, later when I call chatbox.setVisible(true) it does not show up. I dont have to call pack() on the frame every time right?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2006
Added on Nov 23 2006
12 comments
1,260 views