• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaFX FontWeight symbol error  RSS feed

 
Christian Antfeld
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am following along with the Oracle JavaFX tutorial and I am receiving errors galore.  I believe this is the final one needed to be taken care of before the application will compile properly.  I'm not sure what the compiler requires of me to finish this properly.





With this code I am receiving a "cannot find symbol" error on the FontWeight variable.  Is there a specific import that I need to make outside of javafx.scene.text.font?  Is a FontWeight variable needed in my own code or is it declared in the package/class I wrote in the previous sentence?


Thank you for reading and any help


 
Vasyl Lyashkevych
Ranch Hand
Posts: 70
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As can be seen from example here: http://docs.oracle.com/javafx/2/get_started/Login.java.html,
you should make changes:

 
Christian Antfeld
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how I keep making these little mistakes.  Thanks for the help and redirection.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might have been given the error correctly, but you need to know how to solve such errors for yourself. If you go through the JavaFX documentation, you will find this method summary. It has overloaded factory methods, including this one, which I think you are trying to call. Note it has three parameters. There is a four‑parameter overloading, which you shou‍ld find from the first link, but that can't take an int as its third parameter. Actually, it is a double, but the 20 will be automatically cast to 20.0. So you need to supply arguments to match the parameters required by those methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!