The moose likes Swing / AWT / SWT / JFace and the fly likes JSPINNER - ABOUT TIME! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JSPINNER - ABOUT TIME!" Watch "JSPINNER - ABOUT TIME!" New topic
Author

JSPINNER - ABOUT TIME!

Alex Ioannou
Greenhorn

Joined: Nov 14, 2001
Posts: 25
Hi all
Just thought that I would introduce you all to JSpinner, a new feature in J2SDK 1.4.
JSpinner provides the arrow interface to increment a value in a textfield. An example of this is in your windows date/time settings, you'll see that you can adjust the year by moving the little arrows to the right of the textbox.
I'm surprised that earlier versions of the J2SDK did not implement this, but at least they have now.
Well here is a bit of sample code, enjoy.
Al
Gregg Bolinger
Sheriff

Joined: Jul 11, 2001
Posts: 15040

Actually, you could implement this on earlier versions. Make a thin JTextArea with a Vertical Scroll Pane and append all your values to the list before drawing it.
There is always a work around. Don't ever become dependent on API's.
Just my two cents.

------------------
Happy Coding,
Gregg Bolinger


My Blog | DZone Articles
Michael Szul
Ranch Hand

Joined: Sep 18, 2001
Posts: 57
I, personally, was more thrilled with the addition of regular expressions.
 
 
subject: JSPINNER - ABOUT TIME!
 
Threads others viewed
A Multitude of questions
Which Swing component to use ?
Prevent editing of a JSpinner's text box
JSpinner decimal input
JTextField with arrow listener(up&down).
IntelliJ Java IDE