I need help. I have one panel which can need to have width 1000px. I need to add lot of buttons with different size ( I add with flow layout and it works fine). Problem is that
Add your panel to scrollpane and add that pane where you are adding your panel instead of panel
JScrollPane jScrollPane = new JScrollPane(panel);