contenu2.add(DoodeVert);
most mistakes in your samples are layout settings.
- Adding a component when using other layouts than FlowLayout is done with a constraint : BorderLayout -> South, north… ; GridBagLayout * -> gridbagconstraints instance; etc.
- And at least one of the component must set a preferredSize if no “fixed” component like JLabel or JprogressBar are present.
- each modification sequence after setVisible(true) must be explicitely validated
- when handling multiple threads, ensure you’re in the EventDispatcherThread to make such layout modifications : SwingUtilities are therefore recommended tools.
- : GridBagLayout may generally render a better look and feel, but is tricky.