i have a jdialog with a jpanel inside it.I have jlabels(pictures) on the jpanel.How can i get a vertical scrollbar in jdialog without using textarea?
Asked
Active
Viewed 5,534 times
-2
-
your another questions about same topic, are you think that's is really time to shows your code that display us what did you tried :-) – mKorbel Jul 05 '11 at 10:41
2 Answers
3
May be you should try adding your jpanel in JScrollPane so when panel goes beyond limit scroll will be shown.

Harry Joy
- 58,650
- 30
- 162
- 207
-
After adding scrollpane to jpanel i cannot place the labels the way i wanted. – hemanth kumar Jul 05 '11 at 10:12
-
Which way do you want your labels? what's the problem you are facing when trying this? – Harry Joy Jul 05 '11 at 10:13
-
i want to place the label in the middle of the panel but the label moves to the extreme left of the panel – hemanth kumar Jul 05 '11 at 10:15
-
1@Hemanth: Change your layout. Depending on your need in this question you should try BorderLayout. Add jlabel to center of it. Don't use group layout. – Harry Joy Jul 05 '11 at 10:41
2
I agree with Harry. You should use JScrollPane
and work your way with the different ScrollBar Policies
.
See this tutorial on JScrollPane and how to use it.

c00kiemon5ter
- 16,994
- 7
- 46
- 48