Hello developers!
I am losing my head over this issue.
I don't seem to be able to style the triangle (arrow) in a scrollbar.
This is my code to style all the rest of the components:
import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.basic.*;
public class ScrollBarUI extends BasicScrollBarUI {
public ScrollBarUI() {
}
public JButton createIncreaseButton(int orientation) {
JButton btn = super.createIncreaseButton(orientation);
btn.setBackground(Color.BLACK);
btn.setBorder(BorderFactory.createLineBorder(Color.WHITE, 1));
return btn;
}
public JButton createDecreaseButton(int orientation) {
JButton btn = super.createDecreaseButton(orientation);
btn.setBackground(Color.BLACK);
btn.setBorder(BorderFactory.createLineBorder(Color.WHITE, 1));
return btn;
}
public void paintThumb(Graphics g,JComponent c, Rectangle thumbBounds) {
g.setColor(Color.BLACK);
g.fillRoundRect((int)thumbBounds.getX(),(int)thumbBounds.getY(),
(int)thumbBounds.getWidth(),(int)thumbBounds.getHeight(), 5, 5);
}
public void paintTrack(Graphics g,JComponent c,Rectangle trackBounds) {
g.setColor(Color.WHITE);
g.fillRect((int)trackBounds.getX(),(int)trackBounds.getY(),
(int)trackBounds.getWidth(),(int)trackBounds.getHeight());
}
}
If anybody has a solution I would be very gratefull,
Stanny