frame1.setContentPane(new JLabel("Frame 1"));
frame2.setContentPane(new JLabel("Frame 2"));
frame3.setContentPane(new JLabel("Frame 3"));
frame4.setContentPane(new JLabel("Frame 4"));
frame5.setContentPane(new JLabel("Frame 5"));
JDesktopPane desktop = new TabbingDesktopPane();
desktop.add(frame1);
desktop.add(frame2);
desktop.add(frame3);
desktop.add(frame4, LayoutConstraints.bottomOf(frame3));
desktop.add(frame5, LayoutConstraints.tabAfter(frame4));
JFrame frame = new JFrame("Dockingtest");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(frame.getToolkit().getScreenSize());
frame.setContentPane(desktop);
frame.setVisible(true);