Solved

customize JScrollBar painting

Posted on 2004-03-22
5
341 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 213
servlet requestdispatcher include and forward differences 1 39
servlet example 11 49
jboss wildfly 10.1 10 236
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

829 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