>> I cannot find the javax.swing component that does the following. A fairly
>> common control on the right side of a TextField, consisting of two small
[quoted text clipped - 4 lines]
>> Thank you
> The only thing I can think of is in combination with a JSpinner
> No JSpinner in my Java Developers ALMANAC :-(
>
[quoted text clipped - 6 lines]
>>> Thank you
>> The only thing I can think of is in combination with a JSpinner
I did not know that you *only* look at the "Almanac" to see what
objects\classes java supported. Yes you will not find the JSpinner in
the Almanac. I built mine working from the JDK API Specs.
You should get into a habit of referencing it, life will be much easer.
You will have to look at the API Specs for Spinner\SpinnerNumberModel(s)
to changed a few things but here is some code to get you going..
private JSpinner spinnerCompareSize;
private SpinnerNumberModel spinnerModelCompareSize;
public JSpinner buildSpinner(String toolTip)
{
Dimension spinnerDimension = new Dimension(35, 25);
spinnerCompareSize = new JSpinner();
spinnerCompareSize.setToolTipText(toolTip);
spinnerCompareSize.putClientProperty("is3DEnabled", Boolean.TRUE);
spinnerCompareSize.setMinimumSize(spinnerDimension);
spinnerCompareSize.setPreferredSize(spinnerDimension);
spinnerCompareSize.setMaximumSize(spinnerDimension);
spinnerModelCompareSize = new SpinnerNumberModel(12, 0, 100, 1);
//
// Disable keyboard edits in the spinner
JFormattedTextField tf =
((JSpinner.DefaultEditor)
spinnerCompareSize.getEditor()).getTextField();
tf.setEditable(false);
spinnerCompareSize.setModel(spinnerModelCompareSize);
spinnerCompareSize.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent evt) {
JSpinner spinner = (JSpinner)evt.getSource();
quoteCompareSize =
(Integer)((JSpinner)evt.getSource()).getValue();
}
});
return spinnerCompareSize;
}

Signature
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
IchBin - 28 Jan 2006 19:22 GMT
>> No JSpinner in my Java Developers ALMANAC :-(
>>
[quoted text clipped - 45 lines]
> return spinnerCompareSize;
> }
Just in case..
import javax.swing.JSpinner;
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Martijn Mulder - 29 Jan 2006 08:37 GMT
This is very nice. Thank you! JSpinner is just what I was looking for and
with your example and with the specs from internet I'll find out how to use
it. JSpinner rules :-)
>> No JSpinner in my Java Developers ALMANAC :-(
>>
[quoted text clipped - 44 lines]
> return spinnerCompareSize;
> }
IchBin - 29 Jan 2006 13:32 GMT
> This is very nice. Thank you! JSpinner is just what I was looking for and
> with your example and with the specs from internet I'll find out how to use
[quoted text clipped - 48 lines]
>> return spinnerCompareSize;
>> }
Please stop top posting your responses in these NG's.
You can also look at the 'Big Index' on how to use the JSpinner
http://java.sun.com/docs/books/tutorial/reallybigindex.html
particularly:
http://java.sun.com/docs/books/tutorial/uiswing/components/spinner.html

Signature
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Monique Y. Mudama - 30 Jan 2006 02:00 GMT
>> This is very nice. Thank you! JSpinner is just what I was looking
>> for and with your example and with the specs from internet I'll
>> find out how to use it. JSpinner rules :-)
>
> Please stop top posting your responses in these NG's.
Please practice better trimming before critiquing others' netiquette.
You included 73 lines that were in no way required for post
comprehension. That's even more annoying than top posting.

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html