import java.util.*;
import javax.swing.*;
import java.awt.*;public class Test extends JFrame
{
  public static void main(String[] args) {
    Test test=new Test();
  }  public Test()
  {
    this.setSize(640,512);
    JPanel p1=new JPanel();
    p1.setBackground(Color.gray);
    p1.setBorder(BorderFactory.createLineBorder(Color.red));
    this.getContentPane().add(p1,BorderLayout.CENTER);    JToolBar tb=new JToolBar();
    tb.add(new JButton("One"));
    tb.add(new JButton("Two"));
    tb.add(new JButton("Three"));
   this.getContentPane().add(tb,BorderLayout.NORTH);
   tb.setLocation(145,145);    this.setVisible(true);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
}