JInternalFrame
Java Swing Tutorial Explaining the JInternalFrame class. A JInternalFrame is confined to a visible area of a container it is placed in. JInternalFrame a top level swing component that has a contentpane.
- It can be iconified — in this case the icon remains in the main application container.
- It can be maximized — Frame consumes the main application
- It can be closed using standard popup window controls
- It can be layered
JInternalFrame Source Code
import javax.swing.JInternalFrame; import javax.swing.JDesktopPane; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JMenuBar; import javax.swing.JFrame; import java.awt.event.*; import java.awt.*; public class JInternalFrameDemo extends JFrame { JDesktopPane jdpDesktop; static int openFrameCount = 0; public JInternalFrameDemo() { super("JInternalFrame Usage Demo"); // Make the main window positioned as 50 pixels from each edge of the // screen. int inset = 50; Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setBounds(inset, inset, screenSize.width - inset * 2, screenSize.height - inset * 2); // Add a Window Exit Listener addWindowListener(new WindowAdapter() { |
Output
Download JInternalFrame Source Code
Java JInternalFrame Hierarchy
javax.swing
Class JInternalFrame
java.lang.Object
|
+–java.awt.Component
|
+–java.awt.Container
|
+–javax.swing.JComponent
|
+–javax.swing.JInternalFrame
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants
Class JInternalFrame
java.lang.Object
|
+–java.awt.Component
|
+–java.awt.Container
|
+–javax.swing.JComponent
|
+–javax.swing.JInternalFrame
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants
JInternalFrame Constructor
JInternalFrame()
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with no title.
JInternalFrame(String title)
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title.
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with no title.
JInternalFrame(String title)
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title.
JInternalFrame(String title, boolean resizable)
Creates a non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title and resizability.
Creates a non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title and resizability.
JInternalFrame(String title, boolean resizable, boolean closable)
Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title, resizability, and closability.
Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title, resizability, and closability.
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable)
Creates a non-iconifiable JInternalFrame with the specified title, resizability, closability, and maximizability.
Creates a non-iconifiable JInternalFrame with the specified title, resizability, closability, and maximizability.
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
Creates a JInternalFrame with the specified title, resizability, closability, maximizability
Creates a JInternalFrame with the specified title, resizability, closability, maximizability
0 comments:
Post a Comment