Sono tornato al GridBagLayout. La JList ora sembra tenere la larghezza fissa, ma ho un altro problema.. "anchor" non fa una fottuta minchia. Cmq io lo imposti mi allinea sempre come cazzo gli pare..
codice:
p = getContentPane();
// slides
p.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
String[] asd = new String[100];
Arrays.fill(asd, "ASD");
listThumbs = new JList(asd);
JScrollPane scroller = new JScrollPane(listThumbs);
scroller.setPreferredSize(new Dimension(120, Integer.MAX_VALUE));
c.anchor = GridBagConstraints.FIRST_LINE_START;
c.gridx = 0;
c.gridy = 0;
c.weightx = 0.0;
c.weighty = 1.0;
c.ipadx = 120;
p.add(scroller, c);
picSlide = new JLabel();
picSlide.setIcon(new ImageIcon("C:/Documents and Settings/rox/My Documents/Immagini/stateoftheart.png"));
picSlide.setBorder(BorderFactory.createEtchedBorder());
c.anchor = GridBagConstraints.CENTER;
c.gridx = 1;
c.gridy = 0;
c.weightx = 1.0;
c.weighty = 1.0;
p.add(picSlide, c);
Ecco il risultato:
http://design.homeunix.org/~rox/layout.jpg
Sto impazzendo.