public Mainframe(int x,int y, int wf, String titel,Color bg,String sprache)
{
setTitle(titel);
setSize(x,y);
setVisible(true);
Image image = Toolkit.getDefaultToolkit().getImage("symbols/progicon.gif");
setIconImage(image);
setBackground( bg );
addWindowListener( new WindowAdapter() {
//....
CreateMenu(menu1);
CreateToolbar();
//....
toolManager = this.swingCanvas.getToolManager();
initTools();
statusPanel = new JPanel();
statusPanel.setLayout(new BorderLayout());
statusLabel = new JLabel(" ");
statusPanel.add(statusLabel, BorderLayout.WEST);
topPanel2 = new JPanel();
topPanel2.setLayout(new BorderLayout());
topPanel2.add(menuToolbar, BorderLayout.NORTH);
topPanel2.add(topPanel, BorderLayout.SOUTH);
menuToolbar.setLayout(new BorderLayout());
menuToolbar.add(menu1, BorderLayout.WEST);
desktoppane = new JDesktopPane();
desktoppane.setLayout(new BorderLayout());
desktoppane.add(swingCanvas, BorderLayout.CENTER);
desktoppane.setBackground(Color.darkGray);
getContentPane().add(topPanel2, BorderLayout.NORTH);
getContentPane().add(desktoppane,BorderLayout.CENTER);
getContentPane().add(statusPanel, BorderLayout.SOUTH);
swingCanvas.setVisible(false);
getContentPane().setBackground(Color.darkGray);
}
private void CreateToolbar()
{
JToolBar myToolbar = new JToolBar();
JToolBar myToolbar2 = new JToolBar();
JToolBar myToolbar3 = new JToolBar();
JToolBar myToolbar4 = new JToolBar();
setVisible(true);
getContentPane().setLayout(new BorderLayout());
topPanel = new JPanel();
topPanel.setBorder(BorderFactory.createEtchedBorder());
toolPanel = new JPanel();
toolPanel2 = new JPanel();
toolPanel3 = new JPanel();
toolPanel4 = new JPanel();
topPanel.setLayout(new FlowLayout(FlowLayout.LEFT,-5, -5)); //<----- !!
topPanel.add(toolPanel);
topPanel.add(toolPanel2);
topPanel.add(toolPanel3);
topPanel.add(toolPanel4);
toolPanel.add(myToolbar);
toolPanel2.add(myToolbar2);
toolPanel3.add(myToolbar3);
toolPanel4.add(myToolbar4);
}
//..