JScrollPane>Always finding this difficult to work with
I am always finding difficult to work with JScrollPane. I have a JDialog popping up when i click a button. In the JDialog, i would like to have a JScorllPane which has two fields. Field type and its corresponding name. There are a lot of these pairs which change dynamically. Field type should be on the left side and name should be on the right side. Initially i was not using scrollPanes. I was simply adding them to the contentPane of JDialog by creating JLabels and setting their bounds. The portion alotted for them is restricted.
Now, i have to use a ScrollPane to which i have to add these components. I tried to directly add the components to the scrollPane instead of adding to the conentPane. Not a single one is viewable. I tried using validate(). No use. I tried adding the components to a JPanel and adding that to the ScrollPane. No use. Can any one tell me a solution to do this? Even a generalized one is useful. If anyone has already implemented anything with ScrollPanes like adding some Labels to it or adding some Panels, that would be great too.

