• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to label a tick stop on snap to JSlider

 
Douglas Braxton
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i label the snap to tick marks on a JSlider with three tick marks
"RARE", "MED", & "WELL"?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this setLabelTable(Dictionary labels) method in the JSlider api. In the Dictionary api it says that the class is obsolete and to implement the Map interface in lieu of Dictionary. At the top of the api it shows Hashtable as a subclass of Dictionary. The Hashtable api shows that it implements the Map interface. So we can use Hashtable in place of Dictionary. The setLabelTable method detail shows the form of the entries for the Hashtable to be { Integer, JComponent }.
 
Douglas Braxton
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
craig
thanks. i have been getting some deprecation warnings. i wonder if that is what these are referring to.
doug
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not too sure I understand what you're asking. Generally a request from the compiler means you are using code written in/for an antique sdk.

To find out what the deprecation warnings are pointing to compile with

The compiler will list the deprecated methods and then create your class files. Look up the methods in their respective api to find what they have been replaced with.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!