Example usage for javafx.collections ObservableList remove

List of usage examples for javafx.collections ObservableList remove

Introduction

In this page you can find the example usage for javafx.collections ObservableList remove.

Prototype

public void remove(int from, int to);

Source Link

Document

A simplified way of calling sublist(from, to).clear() .

Usage

From source file:Main.java

public static void main(String[] args) {
    ObservableList<String> list = FXCollections.observableArrayList("one", "two");
    System.out.println(list);//from   ww  w . j  av a2s  . co m

    list.addListener(Main::onChanged);

    list.addAll("A", "B");
    System.out.println("After addAll() - list: " + list);

    list.remove(1, 3);
    System.out.println("After remove() - list: " + list);

    list.retainAll("one");
    System.out.println("After retainAll() - list: " + list);

    list.set(0, "ONE");
    System.out.println("After set() - list: " + list);
}