I am unable to clear the border on a TextField using CSS. When I set a border it seems to add my border to the default ones - I can find no way to turn off the default one.
Discussed on the forum here: https://forums.oracle.com/forums/thread.jspa?threadID=2280232
I have tried the following:
public class TestApp extends Application
{
public static void main(String[] args) throws Exception
{
launch(args);
}
public void start(Stage stage) throws Exception
{
Pane root = new FlowPane(4, 4);
TextField textField1 = new TextField();
textField1.setStyle("-fx-border-width: 2; -fx-border-color: green;");
root.getChildren().add(textField1);
TextField textField2 = new TextField();
textField2.setStyle("-fx-border-width: 0;");
root.getChildren().add(textField2);
TextField textField3 = new TextField();
textField3.setStyle("-fx-border-style: none;");
root.getChildren().add(textField3);
stage.setScene(new Scene(root, 600, 300));
stage.show();
}
}
My expectation is that by setting a border on the TextField, the default one will not show.
Cheers,
zonski
Discussed on the forum here: https://forums.oracle.com/forums/thread.jspa?threadID=2280232
I have tried the following:
public class TestApp extends Application
{
public static void main(String[] args) throws Exception
{
launch(args);
}
public void start(Stage stage) throws Exception
{
Pane root = new FlowPane(4, 4);
TextField textField1 = new TextField();
textField1.setStyle("-fx-border-width: 2; -fx-border-color: green;");
root.getChildren().add(textField1);
TextField textField2 = new TextField();
textField2.setStyle("-fx-border-width: 0;");
root.getChildren().add(textField2);
TextField textField3 = new TextField();
textField3.setStyle("-fx-border-style: none;");
root.getChildren().add(textField3);
stage.setScene(new Scene(root, 600, 300));
stage.show();
}
}
My expectation is that by setting a border on the TextField, the default one will not show.
Cheers,
zonski