/* 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.  

4. public class FLaySw 

5. extends JApplet 

6.

7.   JButton btn ; 

8.   JLabel lbl; 

9.   JTextField tf; 

10.   Container cp ; 

11.  

12.   public FLaySw ( ) 

13.   { 

14.     btn = new JButton ( "You can click me, if you want to" ) ; 

15.     tf = new JTextField ( "Move those fingers" ); 

16.     lbl = new JLabel ( "This is too much, I need my therapist" ) ; 

17.   } 

18.  

19.   public void init() 

20.   { 

21.     cp = getContentPane(); 

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

23.     cp.setBackground ( Color.white ) ; 

24.     cp.add ( btn ) ; 

25.     cp.add ( tf ) ; 

26.     lbl.setBackground ( Color.yellow ) ; 

27.     lbl.setOpaque( true ); 

28.     cp.add ( lbl ) ; 

29.   } 

30.