1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
//Création de la fenêtre et des panels
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel mainP = new JPanel();
JPanel quickLaunchP = new JPanel();
JPanel ongletsP = new JPanel();
//Création des layouts
FlowLayout quickLaunchL = new FlowLayout(FlowLayout.LEFT);
FlowLayout ongletsL = new FlowLayout(FlowLayout.LEFT);
BorderLayout mainL = new BorderLayout();
mainP.setLayout(mainL);
//Création des onglets
JTabbedPane tabOnglets = new JTabbedPane(JTabbedPane.TOP);
[...Création des bouton...]
//AJOUTS
quickLaunchP.setLayout(quickLaunchL);
[...Ajout des boutons au pannel quickLaunchP...]
//Onglets
[...Ajout des onglets au JTabbedPane...]
ongletsP.setLayout(ongletsL);
ongletsP.add(tabOnglets);
mainP.add(ongletsP);
mainP.add(quickLaunchP, BorderLayout.NORTH);
frame.getContentPane().add(mainP);
frame.setSize(width, height);
frame.setVisible(true); |
Partager