This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JList+JScrollPane problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList+JScrollPane problem" Watch "JList+JScrollPane problem" New topic

JList+JScrollPane problem

Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
My code is : but JList can't scroll? why?
import javax.swing.*;
public class TestJList
public static void main(String args[])
JFrame jf1=new JFrame();
String[] data = {"one", "two", "three", "four","five","six","seven","eight","nine","ten"};
JList jl1=new JList(data);
JScrollPane pane = new JScrollPane(jl1);

Senior software engineer
Luong Nguyen
Ranch Hand

Joined: May 06, 2001
Posts: 31
The JScrollPane isn't added into the frame.
Have you checked out Aspose?
subject: JList+JScrollPane problem
It's not a secret anymore!