import javax.swing.*;
public class JScrollpaneDemo{
public static void main(String[] arsg) {
String str = "Math_coordinate\n" + "Computer_Programer\n"
+ "Physics"
+ "Chemistry" + "Geography" + "Marathi" + "English" ;
JFrame frame1 = new JFrame("Concept of JScrollPane Container");
frame.setDefaultCloseOperation(JFrame.EXIT);
JPanel panel1 = new JPanel();
JTextArea ar = new JTextArea(str,7,8);
JScrollPane sp = new JScrollPane(ar);
panel1.add(sp);
frame1.add(panel1);
frame.setVisible(true);
frame.setSize(500,500);
}
}
Bookmarks