Solved

customize JScrollBar painting

Posted on 2004-03-22
5
338 Views
Last Modified: 2008-03-03
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
0
Comment
Question by:hapciu
  • 4
5 Comments
 
LVL 13

Expert Comment

by:Webstorm
ID: 10653115
Hi hapciu,

JScrollbar may use subcomponents for arrow buttons.


0
 
LVL 13

Accepted Solution

by:
Webstorm earned 50 total points
ID: 10653167
Try to make a ScrollBarUI subclass instead (javax.swing.plaf package), and use it with your scrollbar:

  jscrollbar.setUI( new <yoursubclass_of_scrollbarUI>());
0
 

Author Comment

by:hapciu
ID: 10653851
ScrollBarUI is an abstract class. and is also empty .... what exactly do i do ?
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 10653899
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
 
LVL 13

Expert Comment

by:Webstorm
ID: 10675516
:-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now