Hello everybody.
Let me start by sending a huge Compliment to the user James_D in the stack Overflow Website.
This is the page with his answer:
https://stackoverflow.com/questions/...d-color-change
Let me tell you I really strugled with this one.
But I've solved my problem.
Initially I just used a call to the method updateChart inside the start method:
updateChart(pieChart);
This changed only the colors in the pies but not in the labels.
It is necessary to put the button with the associated action to update the chart.
PieChart chart = new PieChart();
Button button = new Button("Generate Data");
button.setOnAction(e -> updateChart(chart));
when I click in the button, the PieChart is created with the same colors for the pies in the graph and also for the legends.
I really have to end by repeating myself with a huge Compliment to the user James_D in the stack Overflow Website.
Thank you James_D
Rogério