package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import javax.swing.*;
//import javax.swing.plaf.basic.*;

public class MainPanel extends JPanel{
    private final JComboBox combo  = makeComboBox();
    private final JLabel label     = new JLabel();
    private final JToolBar toolbar = new JToolBar("toolbar");
    private final JButton button   = new JButton("button");
    public MainPanel() {
        super(new BorderLayout());
//         toolbar.setUI(new BasicToolBarUI() {
//             public boolean canDock(Component c, Point p) {
//                 return super.canDock(c, p) ? isHorizontalDockingConstraint(c, p) : false;
//             }
//             private boolean isHorizontalDockingConstraint(Component c, Point p) {
//                 if(!c.contains(p)) return false;
//                 int iv = (toolBar.getOrientation() == JToolBar.HORIZONTAL) ? toolBar.getSize().height : toolBar.getSize().width;
//                 return p.x < c.getWidth()-iv && p.x >= iv;
//             }
//         });
        button.setFocusable(false);

        toolbar.add(new JLabel("label"));
        toolbar.add(Box.createRigidArea(new Dimension(5,5)));
        toolbar.add(button);
        toolbar.add(Box.createRigidArea(new Dimension(5,5)));
        toolbar.add(combo);
        toolbar.add(Box.createGlue());

        label.setText("<html>dockable: NORTH,SOUTH<br>undockable: EAST,WEST");
        label.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        add(toolbar, BorderLayout.NORTH);
        add(label);
        add(Box.createRigidArea(new Dimension()), BorderLayout.WEST);
        add(Box.createRigidArea(new Dimension()), BorderLayout.EAST);
        setPreferredSize(new Dimension(320, 200));
    }
    @SuppressWarnings("unchecked")
    private static JComboBox makeComboBox() {
        DefaultComboBoxModel model = new DefaultComboBoxModel();
        model.addElement("1111111");
        model.addElement("22222");
        model.addElement("3333333333333333");
        model.addElement("44444444444");
        return new JComboBox(model);
    }
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try{
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }catch(Exception e) {
            e.printStackTrace();
        }
        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}

@@ -133,16 +133,17 @@
 ng.*;%0A//
+ 
 import j
@@ -494,18 +494,18 @@
 ut());%0A/
-/ 
+*%0A
         
@@ -537,26 +537,24 @@
 olBarUI() %7B%0A
-//
             
@@ -553,16 +553,25 @@
         
+@Override
  public 
@@ -602,35 +602,32 @@
 t c, Point p) %7B%0A
-// 
                 
@@ -692,35 +692,32 @@
 (c, p) : false;%0A
-// 
             %7D%0A//
@@ -706,34 +706,32 @@
 ;%0A            %7D%0A
-//
              pri
@@ -726,17 +726,16 @@
         
- 
 private 
@@ -796,19 +796,16 @@
 nt p) %7B%0A
-// 
         
@@ -845,18 +845,16 @@
  false;%0A
-//
         
@@ -861,17 +861,16 @@
         
- 
 int iv =
@@ -974,19 +974,16 @@
 .width;%0A
-// 
         
@@ -1033,23 +1033,30 @@
  %3E= iv;%0A
-//
+       
      
+%7D%0A
         
@@ -1060,19 +1060,23 @@
    %7D
-%0A//
+);%0A/*/%0A
         
  %7D);
@@ -1067,28 +1067,161 @@
 /*/%0A        
- %7D);
+add(Box.createRigidArea(new Dimension()), BorderLayout.WEST);%0A        add(Box.createRigidArea(new Dimension()), BorderLayout.EAST);%0A//*/%0A
 %0A        but
@@ -1245,17 +1245,16 @@
 false);%0A
-%0A
         
@@ -1720,148 +1720,8 @@
 l);%0A
-        add(Box.createRigidArea(new Dimension()), BorderLayout.WEST);%0A        add(Box.createRigidArea(new Dimension()), BorderLayout.EAST);%0A
     
@@ -1761,17 +1761,17 @@
 n(320, 2
-0
+4
 0));%0A   

comment style