I have a JSpinner
object that fills the entire JPanel
it is contained in. How do I set a spinner to a single line and the maximum length of it is the panel width?
Asked
Active
Viewed 1,209 times
1

Andrew Thompson
- 168,117
- 40
- 217
- 433

andrew Patterson
- 559
- 2
- 6
- 19
-
2By using the appropriate layout manager. See http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html – Gilbert Le Blanc Mar 19 '13 at 14:55
-
U better add it to a `Panel` and sets its size `panel.setPreferredSize(new Dimension(300, 100));` – Vitthal Mar 19 '13 at 14:57
-
1@Vitthal wrong, setXXSize a [no-no-never](http://stackoverflow.com/a/7229519/203657) .. – kleopatra Mar 19 '13 at 15:46
-
1For [example](http://stackoverflow.com/questions/7374659). – trashgod Mar 19 '13 at 16:53
-
1) Don't include sigs. in questions, they are noise. 2) Use the correct case for J2SE classes. – Andrew Thompson Mar 20 '13 at 02:04