Note: I'm new to LayoutManagers or GUIs in general.
I've been working for this for hours and search for any reference and solutions and I still don't know why my components are overlapping. My GUI should look somewhat like this see correct output here
when I run my program and maximize itsee my output here
The two components are found in two different methods the code for toolbar is this
void the Tool(){
JPanel panel=new JPanel(new FlowLayout(FlowLayout.LEFT));
JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
//4 buttons
//adding buttons to toolBar
panel.add(toolBar);
panel.setSize(300,300);
add(panel,BorderLayout.NORTH);
validate();
}
Meanwhile my code for the panel goes something like this
void thePanel(){
JPanel panel=new JPanel(new FlowLayout(FlowLayout.CENTER));
JLabel label=new JLabel(new ImageIcon("panel.jpg"));
panel.add(label);
add(panel,BorderLayout.NORTH);
validate();
}