Source Code : List with and without ScrollPane
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
List with and without ScrollPane

import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
public class TenJList {
public static void main(String args[]) {
String labels[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" };
JFrame f = new JFrame("Example JList");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JList jlistNoScroll = new JList(labels);
JList jlistScroll = new JList(labels);
Container c = f.getContentPane();
c.add(jlistNoScroll, BorderLayout.WEST);
JScrollPane sp = new JScrollPane(jlistScroll);
c.add(sp, BorderLayout.EAST);
f.setSize(300, 200);
f.setVisible(true);
}
}
Thank with us