Consegui usar! Foi só incluir diretamente no JFrame e posicionar com SetBounds.

JScrollPane scroller = new JScrollPane(list);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
scroller.setBounds(120, 110, 301, 140);

janela.add(scroller);

Agora só estou com um pequeno problema: o JScrollPane tem uma espécie de borda, 
daí ele fica diferente dos outros campos (segue a imagem). Tem alguma forma de 
colocar essa borda nos outros ou tirar a dele?


________________________________
 De: Peter P. Lupo <[email protected]>
Para: [email protected] 
Enviadas: Segunda-feira, 21 de Novembro de 2011 23:19
Assunto: Re: [comp2-geral] Re: Como pôr ScrollBar em JList?
 

Não só para o scrollbar mas veja se o próprio jlist não está com tamanho 
reduzido. Se ele estiver com o tamanho da área visível do jscrollpane, ele 
mesmo vai truncar a string, além do scrollpane não notar a necessidade de uma 
barra de rolagem, já que o componente coube todo.

Peter P. Lupo
http://craftnicely.blogspot.com- http://sites.google.com/site/pplupo
MPS.BR Authorized Implementation Practitioner- Certified ScrumMaster
Oracle Certified Associate, Java SE 5/SE 6 - Java Black Belt
+55 (021) 81742487



2011/11/20 Diego C.F. <[email protected]>

Vitor, tenta estabelecer um tamanho, adicione isto:
>
>scroller.setPreferredSize( new Dimension(250,200) );
>
>Deve funcionar agora.
>
>Abraços! :)
>
>
>--
>You received this message because you are subscribed to the Google Groups 
>"Comp 2 - Geral" group.
>To post to this group, send email to [email protected].
>To unsubscribe from this group, send email to 
>[email protected].
>For more options, visit this group at 
>http://groups.google.com/group/comp2-geral?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Comp 
2 - Geral" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/comp2-geral?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Comp 
2 - Geral" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/comp2-geral?hl=en.

<<attachment: screenshot.png>>

Responder a