import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class MyFrame extends JFrame {
	MyFrame(String s) {
        super(s);
        Double x=new Double(Math.random()*400);
        Double y=new Double(Math.random()*400);
        setLocation(x.intValue(), y.intValue());
        JButton button = new JButton("Ok");
        button.setMnemonic(KeyEvent.VK_K);
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
         	    dispose();	
            }
        });
        label = new JLabel("Welkom bij van C++ naar Java.");
        label.setFont(new Font("Arial", Font.BOLD, 24));
		getContentPane().setBackground(new Color(0x00BdBd));
		setLayout(new FlowLayout());
        add(label);
        add(button);
        pack();
        setVisible(true);
        addMouseListener(new MouseAdapter() {
		    public void mouseEntered(MouseEvent event) {
			    label.setForeground(Color.red);
		    }
		    public void mouseExited(MouseEvent event) {
		   	    label.setForeground(Color.white);
			}
     	});
    }
    private JLabel label;
}

public class Welkom4 {
    public static void main(String[] args) {
		try {
//			UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
//			UIManager.setLookAndFeel("javax.swing.plaf.metal.OceanTheme");
//			UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
//			UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch (Exception e) { }
        //see: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
	    javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                JFrame frame1 = new MyFrame("Welkom!");
                frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                JFrame frame2 = new MyFrame("Ook welkom!");
            }
        });
    }
}
