• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Checkboxes, ImageView and Writing to a Text File

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to JavaFX and so I apologize if the questions are obvious.

1. How can I set my checkbox choices to my genre instance from my movie class.
2. I am having issues getting my imageView to work and I am not sure why.
3. I am unable to get this line to write to my txt file

Movie Class



Controller

 
Marshal
Posts: 64666
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Why are you giving your Movie class all those setXXX methods? Why not set the fields from the constructor? If you have a no‑arguments constructor, you are risking having the object in an inconsistent state when you use it. In fact you are using the Movie instance to get its duration in line 78 before you set that duration. What goes wrong? Do you get a number format exception? Or does it record the length as 0?
I suggest you give the Movie class a toString method which produces the output to be used in lines 84‑85. Also give it a constructor taking a String of the same format. There is a little problem with that approach. It means you can never change the toString method nor that constructor once they have been finally implemented.

Can you get the duration from the slider as an int from some property or other?
 
Campbell Ritchie
Marshal
Posts: 64666
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The number of % tags in line 84 doesn't seem to match the number of arguments in line 85.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!