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!

Can't get a rounded text area ( it still shows square corners if scroll bars are pulled ) inside a s

2644576Nov 11 2015 — edited Nov 11 2015

Hi,

I wish to style a text area to have rounded corners. I almost did, but I think I missed something important. The corners are rounded but when I scroll the text inside the scroll pane, some square corner appear.

Here is the code I tried ( I posted only the relevant parts )

ScrollPane pane = new ScrollPane();

pane.setFitToWidth(true);

pane.setFitToHeight(true);

pane.setContent(new TextArea(StringUtils.repeat("a", 200)));

vBox.getChildren().add(pane);

.text-area, .text-area .scroll-pane, .text-area .scroll-pane .viewport, .text-area .scroll-pane .content, .scroll-pane .viewport, .scroll-pane .content, .scroll-pane, .scroll-pane .text-area {

-fx-background-color: green;

-fx-background-radius: 25
}

example.png

What did I miss guys?

Kind regards,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2015
Added on Nov 11 2015
0 comments
973 views