
Hello Sir/mam, Can i know how to use JScrollBar to JFrame without adding any JPanel to it..
i want to add JScrollBar Directly to JFrame...
Please Provide me Simple Example so i can understand it.

import java.awt.*;
import javax.swing.*;
public class SimpleTable{
public static void main(String[] args) {
JFrame frame = new JFrame("Creating JTable Example!");
String data[][] = {{"A","Delhi"},{"B","Kolkata"},
{"C","Chennai"},{"D","Mumbai"},{"E","Hyderabad"},{"F","Bangalore"},
{"G","Pune"},{"H","Lucknow"}};
String col[] = {"Name","Address"};
JTable table = new JTable(data,col);
JScrollPane pane=new JScrollPane(table);
frame.add(pane);
frame.setSize(300,120);
frame.setVisible(true);
}
}