I read the book1 "Technologies java2", perform tasks for textual components of the swing and display HTML. In general, when compiling the program in the intellij idea

crashes error: **** Error: (16, 9) java: cannot find symbol symbol: variable browserPane location: class com.deitel.advjhtp1.gui.webrowser.WebBrowser ****

and one more: Error: (34, 43) java: cannot find symbol symbol: goToUrl (java.net.URL) location: variable webBrowserPane of type com.deitel.advjhtp1.gui.webbrowser.WebBrowserPane Question: From the translation it is clear that she can't find any character, but which one?

PS The book is just super and easy to read, but I didn’t understand how to work with it until the end ... And I’m not sure that the code was added to the end, so I’ll add part of the first chapter and a screenshot below what I have. I would be very grateful if Someone will explain how to work with books of this kind and what the java error means: cannot find symbol enter image description here

    1 answer 1

    This error means that such a variable does not exist. Because you have a webBrowserPane , and you are trying to use browserPane .

    Either replace browserPane everywhere with webBrowserPane , or

     private WebBrowserPane webBrowserPane; 

    on

     private WebBrowserPane browserPane; 

    If this typo is present in the book, it means that this is a superfluous reminder that books are not perfect (they may contain mistakes and typos) and you need to keep track of what they write. If there is no error in the book, it means that you just need to rewrite the code from the book more carefully.

    And in any case, you need to carefully look at the code you have written, and also pay attention to the IDE hints. For example, in this case, the IDE emphasizes webBrowserPane as an unused class field - this should be alarming already.