customize JScrollBar painting

how can i completely customize the drawing of a JScrollBar ? If i override paintComponent, i still cannot control the way the arrow-buttons are drawn. and i want that...
thanks
hapciuAsked:
Who is Participating?
 
WebstormCommented:
Try to make a ScrollBarUI subclass instead (javax.swing.plaf package), and use it with your scrollbar:

  jscrollbar.setUI( new <yoursubclass_of_scrollbarUI>());
0
 
WebstormCommented:
Hi hapciu,

JScrollbar may use subcomponents for arrow buttons.


0
 
hapciuAuthor Commented:
ScrollBarUI is an abstract class. and is also empty .... what exactly do i do ?
0
 
WebstormCommented:
override the paint(Graphics g, JComponent c) method.

Since no method is abstract in ScrollBarUI or in its super classes, once you create a subclass of ScrollBarUI, you get a concrete class.

0
 
WebstormCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.