bonjour a tous!
Bon ben je sais qu'il y a plein d'exemple sur le forum mais je trouve pas la réponse a mon problème...
J'ai un Jpanel général qui contient d'autres Jpanels afin de pouvoir les organiser dans ma JFrame. Le problème est que la somme de tous mes petits panels est plus grande que l'écran. J'ai donc fais un JScrollPane ou j'ai inclu mon JPanel général... mais il ne m'affiche pas les JScrollBar.
est-ce que j'ai manqué une étape? je vous laisse mon code si jamais...
Merci d'avance pour vos réponses...
public class Panel extends JFrame{
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel panelClient = new JPanel(null);
private JPanel panelAppareil = new JPanel(null);
private JPanel panelSearch = new JPanel(null);
private JPanel panelGeneral = new JPanel(null);
Panel()
{
setTitle("Panel");
setBounds(10,20,420,260);
setExtendedState(MAXIMIZED_BOTH);
setDefaultCloseOperation(EXIT_ON_CLOSE);
createPanel();
JScrollPane jspPanel = new JScrollPane();
jspPanel.setViewportView(panelGeneral);
jspPanel.createVerticalScrollBar();
setContentPane(jspPanel);
setVisible(true);
}
public void createPanel()
{
panelClient = new FormClient().getPanel();
panelClient.setBounds(0,0,400,300);
panelGeneral.add(panelClient);
panelAppareil = new FormAppareil().getPanel();
panelAppareil.setBounds(400, 0, 400, 300);
panelGeneral.add(panelAppareil);
panelSearch = new SearchClient().getPanel();
panelSearch.setBounds(0, 600, 400, 300);
panelGeneral.add(panelSearch);
}
}
++