Solved

customize JScrollBar painting

Posted on 2004-03-22
5
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jdbc error in jsp application 20 71
spring jars download 1 52
ejb message driven bean mdb creation steps 2 34
import as existing maven project 3 34
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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

740 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