File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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.
I agree. Here's the link:
subject: JList+JScrollPane problem
It's not a secret anymore!