aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList+JScrollPane problem" Watch "JList+JScrollPane problem" New topic
Author

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();
jf1.setSize(400,100);
String[] data = {"one", "two", "three", "four","five","six","seven","eight","nine","ten"};
JList jl1=new JList(data);
JScrollPane pane = new JScrollPane(jl1);
jl1.updateUI();
jf1.getContentPane().add(jl1);
jf1.setVisible(true);
}
}


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: http://aspose.com/file-tools
 
subject: JList+JScrollPane problem
 
Similar Threads
Couldn't add items to a JCombboBox at runtime[very...... urgent......]
How to make first row of JList unselectable like JTable
JRadioButtonList error
Couldn't add items to a JCombboBox at runtime[very...... urgent......]
How to create a horizontal JList?