public class DataOfWeather {
private List<Main> main = new ArrayList<>();
private List<TimeModel> timemodel = new ArrayList<>();
// getters and setters…
public class Main {
private double temp;
private double tempMin;
private double tempMax;
//getters and setters
public class MyUI() extends UI{
WeatherService weatherService = new WeatherService();
Grid<DataOfWeather > grid = new Grid<>();
DataOfWeather weatherList = weatherService.getResponse(url);
grid.setItems(weatherList);
how to set to the grid all list from DataOfWeather.class Weather & Main?
gird.addColumn(DataOfWeather::getMain)
bu how to put all list like that → getMain().getTemp() ?
You need to provide a function that is called with an instance of DataOfWeather and returns your temp from Main.
grid.addColumn( x → getMain().getTemp() ); should do.
Note that this is potentially a bad design and you probably want to have the temperatures within your DataOfWeather class.
its not simple like look on first time…that one im already try like week ago, but where “get(i)”,
that error becouse (i) “Error:(66, 49) java: local variables referenced from a lambda expression must be final or effectively final”… and that not make any sens if i do like that