JAVAFX 实现QQ列表以及闪烁功能
package ztf.start;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import ztf.bean.ChatListModel;
import java.util.Random;
/**
* @Description:
* @Author:ZTF
* @Date:2018/6/6 18:06
*/
public class ListViewWithImages extends Application {
private final Image IMAGE1 = new Image("http://othgjp7hs.bkt.clouddn.com/18-6-8/2780393.jpg");
private final Image IMAGE2 = new Image("http://othgjp7hs.bkt.clouddn.com/18-6-8/36061669.jpg");
private final Image IMAGE3 = new Image("http://othgjp7hs.bkt.clouddn.com/18-6-8/35725819.jpg");
private final Image IMAGEWHITE = new Image("http://othgjp7hs.bkt.clouddn.com/18-6-8/75659527.jpg");
private Image[] listOfImages = {IMAGE1, IMAGE2, IMAGE3};
@Override
public void start(Stage primaryStage) throws Exception {
ListView<ChatListModel> listView = new ListView<>();
ObservableList<ChatListModel> items =FXCollections.observableArrayList (
new ChatListModel("aaa","1","123"),
new ChatListModel("bbb","2","123"),
new ChatListModel("ccc"