Dani Gilboa
Dani Gilboa

Reputation: 619

How do i disable JScrollPane borders?

I'm trying to make the JScrollPane transperant, So what i did was:

    scrollPane_1.setViewportBorder(null);
    scrollPane_1.setOpaque(false);
    scrollPane_1.getViewport().setOpaque(false);
    scrollPane_1.setBorder(null);
    scrollPane_1.getViewport().setBorder(null);

So now, the JScrollPane is transparent, But the border still shows, and all my attempts to remove it as failed, How do i remove the border?

-thanks

Upvotes: 0

Views: 533

Answers (1)

Daan Luttik
Daan Luttik

Reputation: 2855

Take a look at the JScrollPane Documentation

This should work:

scrollPane_1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
scrollPane_1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

Upvotes: 1

Related Questions