I noticed that every element which inherits from the Control class has an underscore at the bottom. You can see it in the picture:
When I put a focus on any of items, the line disappears. Why does it happen and how can I get rid of that?
Code:
Main.java
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
sample.fxml
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.control.ComboBox?>
<?import java.lang.String?>
<?import javafx.collections.FXCollections?>
<GridPane stylesheets="@sample.css"
xmlns:fx="http://javafx.com/fxml"
alignment="center">
<HBox>
<ProgressBar minWidth="100" progress="0.3"/>
<Button text="Button"/>
<Button text="Button"/>
<Button text="Button"/>
<ComboBox>
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="String" />
<String fx:value="String" />
<String fx:value="String" />
</FXCollections>
</items>
</ComboBox>
</HBox>
</GridPane>
sample.css
.root {
-fx-background-color: gray;
}