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

Mojo Waters
Mojo Waters
5,748 Points

Break all grey and prepareAttempt

Hi,

So prepareAttempt method. It says that Attempt(java.lang.String com.teamtreehouse.pomodoro.model.AttemptKind) in Attempt cannot be applied to (com.teamtreehouse.pomodoro.model.AttemptKind, java.lang.String). I kinda get it, but I it drives me nuts and I guess I need a break.

Another thing is my BREAK in enum class is all grey. Why is that?

Thank you guys, here's code:

package com.teamtreehouse.pomodoro.controllers;

import com.teamtreehouse.pomodoro.model.Attempt; import com.teamtreehouse.pomodoro.model.AttemptKind; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.layout.VBox;

public class Home {

@FXML
private VBox container;

@FXML
private Label title;

private Attempt mCurrentAttempt;

private void prepareAttempt(AttemptKind kind) {
    clearAttemptStyles();
    mCurrentAttempt = new Attempt(kind, "");
    addAttemptStyle(kind);
    title.setText(kind.getDisplayName());

}

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

}


private void clearAttemptStyles() {

    for (AttemptKind kind : AttemptKind.values()) {
        container.getStyleClass().remove(kind.toString().toLowerCase());

    }
}

public void DEBUG(ActionEvent actionEvent) {
    System.out.println("Hi MOm");
}

}

Mojo Waters
Mojo Waters
5,748 Points

OK I get it with "kind" now, but my BREAK is still grey :(

1 Answer

Mojo Waters
Mojo Waters
5,748 Points

So IntelliJ thinks that my BREAK is a method, not ENUM. I mean when I press Ctrl + U to Focus it drives ENUM.java. but when I do the same on BREAK it doesn't know what I am talking about. What could I possibly mixed up, so it doesn't know that it is an ENUM? Thanks