Java Swing Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 4.00

javax.swing.JInternalFame - Internal Frame Class

This section describes javax.swing.JInternalFame - Internal Frame Class, representing a UI internal frame inside a regular frame.

javax.swing.JInternalFrame - A Swing class representing a UI internal frame inside a regular frame. An internal frame supports almost all the features a regular frame does. Adding an internal frame to a regular frame should be done by adding the internal frame to a desktop pane first, then using the desktop pane as the content pane of the regular frame. Interesting methods of JInternalFrame include:

  • JInternalFrame(String) - Constructor to create an internal frame with the specified string as the frame title.
  • setResizable(boolean) - Method to set this frame to be resizable or not.
  • setClosable(boolean) - Method to set this frame to be closable or not.
  • setMaximizable(boolean) - Method to set this frame to be maximizable or not.
  • setIconifiable(boolean) - Method to set this frame to be iconifiable or not.
  • setSize(int, int) - Method to set the size of this frame. If not set, an internal frame will have zero size and not visible.
  • setVisible(boolean) - Method to set this frame to be visible or not. The default setting is not visible, you must call setVisible(true) to show an internal frame.
  • addInternalFrameListener(InternalFrameListener) - Method to add internal frame listeners to this internal frame.

javax.swing.JDesktopPane - A Swing class representing a container to host internal frames.

  • getSelectedFrame() - Method to return the selected internal frame.

javax.swing.event.InternalFrameListener - A Swing interface for the implementing class to handle internal frame events. Methods include:

  • internalFrameActivated(InternalFrameEvent) - Method to be called when the internal frame is activated.
  • internalFrameClosed(InternalFrameEvent) - Method to be called when the internal frame has been closed.
  • internalFrameClosing(InternalFrameEvent) - Method to be called when the internal frame is in the process of being closed.
  • internalFrameDeactivated(InternalFrameEvent) - Method to be called when the internal frame is de-activated.
  • internalFrameDeiconified(InternalFrameEvent) - Method to be called when the internal frame is de-iconified.
  • internalFrameIconified(InternalFrameEvent) - Method to be called when the internal frame is iconified.
  • internalFrameOpened(InternalFrameEvent) - Method to be called when the internal frame is opened.

Last update: 2009.

Sections in This Chapter

javax.swing.JInternalFame - Internal Frame Class

JInternalFameTest.java - Internal Frame Class Test

javax.swing.InternalFrameListener - Internal Frame Listener Interface

Dr. Herong Yang, updated in 2009
javax.swing.JInternalFame - Internal Frame Class