Solved

customize JScrollBar painting

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

752 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