import java.awt.FlowLayout;
import javax.swing.*;
public class WTest {
@SuppressWarnings("deprecation")
public static void main(String args[]){
JFrame jf = new JFrame("Hello world!");
jf.setSize(300, 500);
JScrollPane jsp = new JScrollPane();
FlowLayout fl = new FlowLayout(FlowLayout.LEFT, 0, 0);
fl.setAlignment(FlowLayout.LEFT);
JPanel jpl = new JPanel(true);
jpl.setLayout(fl);
for(int i = 0; i < 100; ++i){
jpl.add(new JLabel("test "));
}
jsp.setViewportView(jpl);
jf.add(jsp);
//jf.add(jpl);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.show();
}
}