Je l'ai testé sur pas mal de configuration, pour les besoins de mon application. Au total on peu avoir plus de 128 possibilités de placement. Je ne les ai pas toutes testées. Si toutefois vous rencontrez des problèmes ou avez des soucis, n'hésitez pas à me contacter.
Vous pouvez le tester avec ceci :
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
/*
* Created on 7 févr. 2006
*/
/**
* @author nico
*/
public class Test {
public static void testThis(LineLayout ll){
String stringOrientation = ll.getOrientation() == LineLayout.VERTICAL ? "VERTICAL" : "HORIZONTAL";
JFrame frame = new JFrame(stringOrientation);
JPanel panelConteneur = new JPanel();
panelConteneur.setLayout(ll);
for(int i = 0; i <= 7; i++){
JButton bouton = new JButton(i + "");
panelConteneur.add(bouton);
}
frame.setContentPane(panelConteneur);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
LineLayout ll = new LineLayout(LineLayout.VERTICAL, LineLayout.VERTICAL,
LineLayout.CENTER, LineLayout.NONE, 5, 5);
testThis(ll);
/*
for (int orientation = 0; orientation < 2; orientation++) {
for (int etirer = 0; etirer < 5; etirer++) {
for (int alignementHorizontal = 0; alignementHorizontal < 4; alignementHorizontal++) {
for (int alignementVertical = 0; alignementVertical < 5; alignementVertical++) {
LineLayout ll = new LineLayout(orientation, etirer, alignementHorizontal,
alignementVertical, 5, 5);
testThis(ll);
if (alignementVertical == 1)
alignementVertical += 2;
}
}
}
}*/
}
}