Java code is supposed to create a blue sphere (JavaFX forum at Coderanch)
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • paul wheaton
Sheriffs:
Saloon Keepers:
  • Tim Holloway
Bartenders:

Java code is supposed to create a blue sphere

Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have some java code attached that uses the javaFX library to generate a blue sphere and rotate it. However it executes successfully but does not produce the actual sphere. Can you tell what the mistake is? Any help appreciated.
Bartender
Posts: 362
12
IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey! Welcome to the Ranch, but we'd need to see the code you're using to have a chance determining what might be wrong.

Otherwise we're just guessing, like this: If you're doing something 3D, a lot of times you've just got the view frustum pointed in the wrong direction, and you need to play around with locations/sizes.
Abdul Rauf Fawwaz Khan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had attached the Main.java code with the post. Didn't you see the attachment? Here is a link: https://justpaste.it/6z9lh
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added to the start() method (to the end) this and a window was shown:But I do not see the sphere.
Lou Hamers
Bartender
Posts: 362
12
IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No the original attachment isn't visible.

I guess you want something like this?

Sheriff
Posts: 4974
625
VSCode Eclipse IDE Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the original code:

Main.java
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic