public class MainWindow {
@Inject ProfileJPanel profileJPanel;
@Inject
public MainWindow(){
System.out.println(profileJPanel.getName());
}
}
Exception in thread "main" java.lang.NullPointerException
at MainWindow.(MainWindow.java:8)
at MainWindow_Factory.get(MainWindow_Factory.java:20)
at MainWindow_Factory.get(MainWindow_Factory.java:6)
at DaggerMainComponent.createMainWindow(DaggerMainComponent.java:44)
at Main.main(Main.java:8)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
public class MainWindow {
private final ProfileJPanel profileJPanel;
@Inject
public MainWindow(ProfileJPanel profileJPanel){
this.profileJPanel = profileJPanel;
System.out.println(profileJPanel.getName());
}
}