Example of JInternalFrame in swing
- Yashashree
- Aug 17, 2017
- 1 min read
Write a program to demonstrate a Working of JinternalFrame.
import javax.swing.*;
import java.awt.*;
class JInternal extends JFrame
{
JInternalFrame f1;
JDesktopPane p;
public JInternal()
{
createAndShowGUI();
}
private void createAndShowGUI()
{ setDefaultCloseOperation(EXIT_ON_CLOSE);
p=new JDesktopPane();
p.setBackground(Color.GRAY);
f1=new JInternalFrame();
f1.setSize(150,150);
f1.setVisible(true);
f1.setLocation(60,60);
p.add(f1);
add(p);
setSize(400,400);
setVisible(true);
}
public static void main(String args[])
{
new JInternal();
}
}
Output :

Comments