le probleme ne vient peut etre pas de la, mais personellement je construit toujours le scrollpane en dernier, une fois que j'ai fait toutes mes merdes dans mon panel :
JPanel p = new JPanel() ;
//bidouillage du panel
JScrollPane scroll = new JScrollPane(p , JScrollPane.VERTICAL_BAR_AS_NEEDED , JScrollPane.HORIZONTAL_BAR_AS_NEEDED);
aussi, je remarque que tu construit un flowLayout pour lintegrer a ton panel, hors il me semble que quand tu creer un JPanel floawLayout est celui par default :
JPanel() Creates a new JPanel with a double buffer and a flow layout. |
JPanel(boolean isDoubleBuffered) Creates a new JPanel with FlowLayout and the specified buffering strategy. |
JPanel(LayoutManager layout) Create a new buffered JPanel with the specified layout manager |
JPanel(LayoutManager layout, boolean isDoubleBuffered) Creates a new JPanel with the specified layout manager and buffering strategy. |