/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. import javax.swing.*; 

2. import java.awt.*; 

3. import java.awt.event.*; 

4.  

5. public class Child 

6.     extends JApplet 

7.

8.   JDesktopPane dskp ; 

9.   JInternalFrame  child1, child2 ; 

10.  

11.   public void init() 

12.   { 

13.     dskp = new JDesktopPane ( ); 

14.     child1 = new JInternalFrame ( "Internal affairs" ) ; 

15.  

16.     child1.setResizable ( true ); 

17.     child1.setMaximizable ( true ); 

18.     child1.setIconifiable ( true ); 

19.     child1.setClosable ( true ); 

20.  

21.     child1.setBounds ( 25, 50, 225, 150); 

22.  

23.     bt = new JButton ( "JLessons button" ) ; 

24.  

25.     Container cp = child1.getContentPane( ); 

26.     cp.setLayout( new FlowLayout( ) ); 

27.     cp.add ( bt ) ; 

28.  

29.     dskp.setOpaque( false ); 

30.     dskp.add ( child1, JLayeredPane.DEFAULT_LAYER ); 

31.                

32.     child2 = new JInternalFrame ( "Feel framed ?" ) ; 

33.     child2.setBounds ( 100, 150, 300, 100); 

34.     dskp.add ( child2 ); 

35.     child2.moveToFront( ); 

36.     try

37.     child2.setSelected( true ) ; 

38.     } catch (Exception ex) { } 

39.     child1.setVisible(true); 

40.     child2.setVisible(true); 

41.  

42.     setContentPane ( dskp ); 

43.   } 

44.   JButton bt ; 

45.

46.