Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Build a JavaFX Application Build a Pomodoro App Build the State Change Events

How excatly we change the background when we are at different attempt kind?, and how the nested buttons works?

Hi, I need a confirmation about this topic. craig introduced a technique that let us add and remove styles from our app. we use this code to add style:

 private void addAttemptStyle(AttemptKind kind) {
        container.getStyleClass().add(kind.toString().toLowerCase());
    }

i understand that we get the current style from the container and then we add the attemptkind and getting the enum's name(break or focus) from toString and when we get a kind lets say focus, in our css file we have a .focus refernce that change the color, and the question is how javafx knows what is focus if we havent add an id for it in the fxml file?

another thing is that the logic of the fxml file isnt very clear and we havn't dive into that properly, anyone has a external resource or code for learning fxml?

Steven Parker Tonnie Fanadez Eric McKibbin Sean M

4 Answers

Steven Parker
Steven Parker
231,268 Points

I found that 4 out of the first 5 results from a quick Google search were tutorial resources.

Steven Parker i didn’t understand what u said, the link was broken

Steven Parker
Steven Parker
231,268 Points

That's odd, it works for me. But just type "FXML" into your favorite search engine and you'll find several tutorial resources.

LOL. i know we change it with the css the problem is about the code. why when we remove playing we can suddenly see the pause button.