File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTextField in JInternalFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField in JInternalFrame" Watch "JTextField in JInternalFrame" New topic

JTextField in JInternalFrame

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
Dear Ranchers,
In my Java Swing application, I've a
- JMenu
- JToolBar
- JDesktopPane
- JInternalFrame
- JPanel
- JTextField

This is the format of my MDI Form. When the mdi is called, I put the JInternalFrame.setVisible(false);

When an action is occured in JMenuItem, I'm putting the JInternalFrame.setVisible(true);

My problem is, When I enter a value in the JTextField and closes the JInternalFrame, the value appears there. The problem is, I'm hiding the internalframe after entering the value and unhiding it back when i want the internalframe.

Please advise me, how can I remove the values when I close the JInternalFrame. Also the default close operation of the JInternalFrame is "HIDE"

Please reply..


Aravind Prasad
Rob Spoor

Joined: Oct 27, 2005
Posts: 19908

Take a look at the InternalFrameListener interface. With it, you can perform actions when an internal frame is closed, hidden, etc.

How To Ask Questions How To Answer Questions
It is sorta covered in the JavaRanch Style Guide.
subject: JTextField in JInternalFrame