import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import javafx.collections.*;
import javafx.scene.control.*;
import javafx.scene.control.cell.TextFieldListCell;
import javafx.util.StringConverter;
import javafx.util.converter.DefaultStringConverter;
import javafx.scene.text.*;
import javafx.scene.text.Font;
import javafx.event.*;
import java.util.Arrays;

/**
 *
 * Beschreibung
 *
 * @version 1.0 vom 22.01.2025
 * @author 
 */

public class sed extends Application {
  // Anfang Attribute
  private ListView<String> listView1 = new ListView<>();
    private ObservableList<String> zahlen = 
            FXCollections.observableArrayList();
  private Label label1 = new Label();
  private Button button1 = new Button();
  // Ende Attribute
  
  public void start(Stage primaryStage) { 
    Pane root = new Pane();
    Scene scene = new Scene(root, 447, 224);
    
    StringConverter<String> converter =  new DefaultStringConverter();
    // Anfang Komponenten
    
    listView1.setLayoutX(16);
    listView1.setLayoutY(8);
    listView1.setPrefHeight(176);
    listView1.setPrefWidth(120);
    listView1.setItems(zahlen);
    listView1.setEditable(true);
    listView1.setCellFactory(param -> new TextFieldListCell<>(converter));
    
    zahlen.add("1000");
    zahlen.add("182");
    zahlen.add("14");
    zahlen.add("341");
    zahlen.add("161");
    root.getChildren().add(listView1);
    label1.setLayoutX(160);
    label1.setLayoutY(16);
    label1.setPrefHeight(24);
    label1.setPrefWidth(80);
    label1.setText("Antwort");
    label1.setFont(Font.font("Dialog", 11));
    root.getChildren().add(label1);
    button1.setLayoutX(160);
    button1.setLayoutY(48);
    button1.setPrefHeight(24);
    button1.setPrefWidth(80);
    button1.setText("Button");
    button1.setOnAction(
      (event) -> {button1_Action(event);} 
    );
    button1.setFont(Font.font("Dialog", 11));
    root.getChildren().add(button1);
    // Ende Komponenten
    
    primaryStage.setOnCloseRequest(e -> System.exit(0));
    primaryStage.setTitle("sed");
    primaryStage.setScene(scene);
    primaryStage.show();
  } // end of public sed
  
  // Anfang Methoden
  
  public static void main(String[] args) {
    launch(args);
  } // end of main
  
  public void button1_Action(Event evt) {
    zahlen.sorted()
    
  } // end of button1_Action

  // Ende Methoden
} // end of class sed
