Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8128366

Unable to clear border on TextField using CSS

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: fx2.0
    • Fix Version/s: None
    • Component/s: javafx

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              leifs Leif Samuelsson (Inactive)
              Reporter:
              dzwolenskjfx Daniel Zwolenski (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: