JInternalFrame

JInternalFrame is a lightweight object that provides features similar to native window.

     JInternalFrame jn = new JInternalFrame(“InternalFrame”,true,true,true);

The first argument specifies the title to be displayed by the internal frame. The rest of the arguments specify whether the internal frame should contain decorations allowing the user to resize, close, and maximize the internal frame . The default value for each boolean argument is false, which means that the operation is not allowed.

Program

gdgdf



 
 
 

Program Source

import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JButton;
import java.awt.FlowLayout;

class JInternalFrameTest extends JFrame {
            
    JInternalFrameTest()
    {
        setTitle("JInternalFrame");
        setJInternalFrame();
        setSize(700,300);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
   
    void setJInternalFrame()
    {
        JInternalFrame jn = new JInternalFrame("InternalFrame",true,true,true);
        jn.setLayout(new FlowLayout());
        jn.add(new JButton("JButton"));
        jn.setVisible(true);
        add(jn);
    }
}
 
public class Javaapp {
  
    public static void main(String[] args) {
        
        JInternalFrameTest jn = new JInternalFrameTest();
    }
}

Leave a Comment