怎样在JavaFX中实现菜单
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.stage.Stage;
import javafx.application.Application;
import javafx.collections.*;
public class FXComboExample extends Application {
public static void main(String[] args) {
launch(args);
}
@Override public void start(Stage stage){
stage.setTitle("FX ComboBox Example");
Scene scene = new Scene(new Group(), 400, 300);
ObservableList
ComboBox
combo.getSelectionModel().select(0); // [0, options.size())
Group root = (Group)scene.getRoot();
root.getChildren().add(combo);
stage.setScene(scene);
stage.show();
}
}