Source Code : A few interesting things using JInternalFrames, JDesktopPane, and DesktopManager

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

A few interesting things using JInternalFrames, JDesktopPane, and DesktopManager

A few interesting things using JInternalFrames, JDesktopPane, and DesktopManager
  
//An example that shows how to do a few interesting things using
//JInternalFrames, JDesktopPane, and DesktopManager.

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;

public class Figure3 extends JFrame {
  private JDesktopPane desk;

  public Figure3(String title) {
    super(title);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    desk = new JDesktopPane();
    setContentPane(desk);
  }

  private void addFrame(int number) {
    JInternalFrame f = new JInternalFrame("Frame " + number, true, true,true, true);
    f.setBounds(number * 10 - 5, number * 10 - 5, 250, 150);
    desk.add(f, 1);
    f.setVisible(true);
  }

  public static void main(String[] args) {
    Figure3 td = new Figure3("");

    td.setSize(300, 220);
    td.setVisible(true);
    for (int i = 1; i <= 4; i++) {
      td.addFrame(i);
    }
  }
}

           
         
    
  

Thank with us