A few interesting things using JInternalFrames, JDesktopPane, and DesktopManager : InternalFrame « Swing JFC « Java






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);
    }
  }
}

           
         
    
  








Related examples in the same category

1.A quick demonstration of setting up an internal frame in an applicationA quick demonstration of setting up an internal frame in an application
2.A simple extension of the JInternalFrame class that contains a list
3.JDesktopPane demoJDesktopPane demo
4.Working with Internal Frames within a Desktop
5.Internal Frames DemoInternal Frames Demo
6.JDesktopPane Cascade DemoJDesktopPane Cascade Demo
7.Java X WindowsJava X Windows
8.Desktop Manager DemoDesktop Manager Demo
9.Internal Frame Listener Demo Internal Frame Listener Demo
10.Layered Pane DemoLayered Pane Demo
11.LayeredPane Demo 2: Custom MDILayeredPane Demo 2: Custom MDI
12.LayeredPane Demo 3: Custom MDILayeredPane Demo 3: Custom MDI
13.LayeredPane Demo 4: Custom MDILayeredPane Demo 4: Custom MDI
14.Implements InternalFrameListenerImplements InternalFrameListener
15.InternalFrame demoInternalFrame demo
16.InternalFrameEvent DemoInternalFrameEvent Demo
17.A quick setting up an Internal Frame in an applicationA quick setting up an Internal Frame in an application
18.Interesting things using JInternalFrames, JDesktopPane, and DesktopManager 2Interesting things using JInternalFrames, JDesktopPane, and DesktopManager 2
19.Make a JInternalFrame a tool window
20.Move JInternalFrame To Front
21.This program demonstrates the use of internal framesThis program demonstrates the use of internal frames