import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
public class DisplayingText extends Application {
@Override
public void start(Stage stage) {
Text text = new Text();
text.setFont(new Font(45));
text.setX(50);
text.setY(50);
text.setText("Welcome my friend!");
Group root = new Group();
ObservableList list = root.getChildren();
list.add(text);
Scene scene = new Scene(root, 600, 300);
stage.setTitle("Sample Application");
stage.setScene(scene);
stage.show();
}
public static void main(String args[]) {
launch(args);
}
}
The compiler says I am using something not something. Here's what the compiler says:
C:\Users\Resul\Desktop\Skills\For Java>javac -Xlint:unchecked DisplayingText.jav a DisplayingText.java:25: warning: [unchecked] unchecked call to add(E) as a membe r of the raw type List list.add(text); where E is a type-variable: E extends Object declared in interface List 1 warning C:\Users\Resul\Desktop\Skills For Java>
Since I don't know English well, I translated everything the compiler said. But still, I didn't understand what exactly the compiler wants. because it's the first time I'm facing this.