Java Reference
In-Depth Information
If you can answer these questions, then you can put a slider to good use. Once you
have mastered sliders, you can fritter away more time and find out how to set tick
marks or otherwise enhance the visual beauty of your creation.
When you look at the documentation of the JSlider class, you will probably not be
happy. There are over 50 methods in the JSlider class and over 250 inherited
methods, and some of the method descriptions look downright scary, such as the one
in Figure 12 . Apparently some folks out there are concerned about the
valueIsAdjusting property, whatever that may be, and the designers of this
class felt it necessary to supply a method to tweak that property. Until you too feel
that need, your best bet is to ignore this method. As the author of an introductory
book, it pains me to tell you to ignore certain facts. But the truth of the matter is that
the Java library is so large and complex that nobody understands it in its entirety, not
even the designers of Java themselves. You need to develop the ability to separate
fundamental concepts from ephemeral minutiae. For example, it is important that you
understand the concept of event handling. Once you understand the concept, you can
ask the question, ȒWhat event does the slider send when the user moves it?ȓ But it is
not important that you memorize how to set tick marks or that you know how to
implement a slider with a custom look and feel.
809
810
Figure 12
A Mysterious Method Description from the API Documentation
Search WWH ::




Custom Search