import java.awt.event.*;
import javax.swing.*;

public class NoLayoutExample2 extends JFrame {
    public NoLayoutExample2(String name) {
        super(name);

        JTextField newItemField;
        JList      itemsList;
        JButton    addButton;
        JButton    removeButton;

        getContentPane().setLayout(null);

        //The text field
        newItemField = new JTextField();
        newItemField.setLocation(12,12);
        newItemField.setSize(150,30);
        getContentPane().add(newItemField);

        //The Add button
        addButton = new JButton("Add");
        addButton.setMnemonic('A');
        addButton.setLocation(174, 12);
        addButton.setSize(100,30);
        getContentPane().add(addButton);

        //The List
        String[] stuff = {"Apples", "Oranges", "Grapes", "Pineapples", "Cherries"};
        itemsList = new JList(stuff);
        JScrollPane scrollPane = new JScrollPane(itemsList,
        ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        scrollPane.setLocation(12,45);
        scrollPane.setSize(150,150);
        getContentPane().add(scrollPane);

        //The Remove button
        removeButton = new JButton("Remove");
        removeButton.setMnemonic('R');
        removeButton.setLocation(174,45);
        removeButton.setSize(100,30);
        getContentPane().add(removeButton);

        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(296, 240);
        setResizable(false);
    }

    public static void main(String[] args) {
    	try {
			UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
			//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
			//UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
		} catch(Exception e) {}
		JFrame.setDefaultLookAndFeelDecorated(true);


        JFrame frame = new NoLayoutExample2("Example Using Motif L&F");
        frame.setVisible(true);
    }
}