by Dinesh Thakur Category: Swing

An internal frame is similar to a regular frame which can be displayed within another window. It is a lightweight component which can be resized, closed, maximized or minimized depending upon the properties being set. It can also hold a title and a menu bar. An internal frame is an object of JinternalFrame class.

Some of the constructors defined by JinternalFrame class are as follows:


JinternalFrame(String title)

JinternalFrame(String title, boolean resizable)

JinternalFrame(String title, boolean resizable, closable, boolean maximizable, boolean iconifiable)


title specifies the title of the frame

resizable can have one of the two values: true, if the internal frame is resizable; otherwise false (default value)

closable can have one of the two values: true, if the internal frame is closeable, otherwise false (default value)

maximizable can have one of the two values: true, if the internal frame is maximizable, otherwise false (default value)

iconifiable can have one of the two values: true, if the internal frame is minimizable, otherwise false (default value)

The internal frame requires desktop pane which is capable of handling it. The purpose of desktop pane is to hold and manage the working of internal frames. A desktop pane is an object of JDesktopPane class and can be created by using its only constructor JDesktopPane ().

import javax.swing.*;

public class JInternalFrameJavaExample extends JFrame
     public JInternalFrameJavaExample()
    public static void main(java.lang.String[] args)
        JInternalFrameJavaExample InternalFrame = new JInternalFrameJavaExample();
        InternalFrame.setSize(500, 200);
        JInternalFrame IFrame = new JInternalFrame();
        IFrame.setTitle("JInternalFrame Example");
        InternalFrame.setTitle("JInternalFrame Example in Java Swing");

JInternalFrame Example in Java Swing

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Related Articles