Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Change border of JScrollPane/JScrollBar button

boomahMay 4 2010 — edited May 5 2010
Hi all. I want to change the border height of a JScrollPane/JScrollBar down button.

If you look here
image

you will see that the down button has a two pixel line border at the bottom. I would like that to be only a one pixel line border.

Does anyone know how this can be done?

Thanks...
import javax.swing.*;

public class ScrollPaneTest extends JFrame {
    public ScrollPaneTest() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JList list = new JList(new String[] {"bla bla bla","bla bla bla","bla bla bla","bla bla bla","bla bla bla","bla bla bla","bla bla bla","bla bla bla","bla bla bla","bla bla bla"});
        JScrollPane scrollPane = new JScrollPane(list);
        JPanel mainPanel = new JPanel();
        mainPanel.add(scrollPane);
        add(mainPanel);
        pack();
        setLocationRelativeTo(null);
        setVisible(true);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new ScrollPaneTest();
            }
        });
    }
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2010
Added on May 4 2010
2 comments
337 views