0

My program is refusing to run because the "anchorpane" is refusing to support my controller on all my fxml files, hence my fxml page is not loading. Also, it is also giving me error message that my main class could not be found. I would welcome any help or suggestion on the stated.

My fxml file

<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" pickOnBounds="false" prefHeight="614.0" prefWidth="1015.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="winnaccs.WinSecHomeController">

The Controller

public class WinSecHomeController implements Initializable, ControlledScreen {
ScreensController myController;

/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
}    
public void setScreenParent (ScreensController screenParent){
    myController = screenParent;
}

@FXML
private void goToLogin(ActionEvent event) {
    myController.setScreen(Winnaccs.screen2);
}

}

anuel
  • 1
  • 2
  • Maybe this solves your controller-problem? http://stackoverflow.com/questions/14359763/setting-a-class-controller-for-anchor-pane – Seb Jul 25 '14 at 14:27
  • Thanks Seb. Will try it out now. – anuel Jul 25 '14 at 15:03
  • Your question is a bit confusing. If it can't find the main class, it presumably can't run at all, so how are you getting an error loading the fxml? Can you clarify, and post the error message you are getting. – James_D Jul 25 '14 at 19:19

1 Answers1

0

just try to change this one

fx:controller="winnaccs.WinSecHomeController"

with this other

fx:controller="winnaccs/WinSecHomeController"

Ayoub
  • 258
  • 3
  • 8