Showing Tick-Mark Labels on a JSlider Component : Slider « Swing JFC « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Swing JFC » SliderScreenshots 
Showing Tick-Mark Labels on a JSlider Component
 
import javax.swing.JSlider;

public class Main {
  public static void main(String[] argvthrows Exception {
    JSlider slider = new JSlider();

    // Set major tick marks every 25 units
    int tickSpacing = 25;
    slider.setMajorTickSpacing(tickSpacing);

  }
}

   
  
Related examples in the same category
1. Creating a JSlider Component
2. Create a horizontal slider with custom min, max, and value
3. Create a vertical slider with min=0, max=100, value=50
4. Create a vertical slider with custom min, max, and value
5. Make the horizontal slider move right-to-left
6. Make it vertical and move bottom-to-top
7. Make it vertical and move top-to-bottom
8. Get the extent
9. Getting and Setting the Values of a JSlider Component
10. Drawing with Swing, using a JSliderDrawing with Swing, using a JSlider
11. Using progress bars and slidersUsing progress bars and sliders
12. A slider with tick marks and labels
13. An example of JSlider with default labelsAn example of JSlider with default labels
14. Set minor tick marks every 5 units
15. Set major tick marks every 25 units
16. Slider SampleSlider Sample
17. JSlider Sample 2JSlider Sample 2
18. Slider ChangeListenerSlider ChangeListener
19. Inverted SlidersInverted Sliders
20. Slider change action listenerSlider change action listener
21. Date sliderDate slider
22. Slider TestSlider Test
23. Tick SlidersTick Sliders
24. Scroll SliderScroll Slider
25. Text SliderText Slider
26. Change the minimum value
27. Change the maximum value
28. Set the extent
29. Move the slider by a fixed amount: the extent.
30. Set all the values at once by using the model
31. Set the value; the new value will be forced into the bar's range
32. Listening for Value Changes in a JSlider Component
33. Constraining JSlider Component Values to Tick Marks
34. Determine if currently snapping to tick marks
35. Snap to tick marks
36. Set to a spot between tick marks; the value moves to closest tick mark
37. Determine if currently painting labels
38. Showing Tick Marks on a JSlider Component
39. Show tick marks
40. The slider allows you to use an arbitrary label at any particular major tick mark.
41. Hide the track
42. Sample SlidersSample Sliders
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.