how to remove or hide border box of Textarea?

JackCody :

I'm working on JavaFx trying to round the corner of Textarea just like the area of typing message on the WhatsApp

I did try with setStyle for all focus and background; border color, faint

TextArea area=new TextArea();  
area.setStyle( "-fx-region-background: null;"
         + "-fx-text-box-border: transparent;"
         + "-fx-text-fill:black;"
         + "-fx-border-color:#c6c6c6;"
         + " -fx-border-width: 2;"
         + "-fx-border-radius: 30;"
         + "-fx-control-inner-background: transparent;"
         + "-fx-focus-color: transparent;"
         + "-fx-faint-focus-color: transparent;");

this a snap of what I get if i run the code i did succeed to rounded the textarea but sound like still there is a box on the front if you notice the four angles

enter image description here

sound like there is triangle box on front how to remove the border of that triangle

https://i.stack.imgur.com/hhqzJ.jpg

Matt :

This is what worked for me give it a shot let me know if thats not what your looking for

Here is how to do it with a CSS file

.text-area {
    -fx-background-color: transparent;
    -fx-background-radius: 15;
    -fx-border-radius: 15;
    -fx-border-width: 2;
    -fx-border-color: #c6c6c6;
}
.text-area {
    -fx-background-color: transparent;
}
.text-area .viewport{
    -fx-background-color: transparent;
}
.text-area .content{
    -fx-background-color: transparent;
}

enter image description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=149564&siteId=1