Example usage for javafx.collections ObservableList retainAll

List of usage examples for javafx.collections ObservableList retainAll

Introduction

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

Prototype

public boolean retainAll(E... elements);

Source Link

Document

A convenience method for var-arg usage of the #retainAll(Collection) retainAll method.

Usage

From source file:Main.java

public static void main(String[] args) {
    ObservableList<String> list = FXCollections.observableArrayList("one", "two");
    System.out.println(list);//ww w. j  a va2 s  .c  o 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);
}