• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Calling a class from another class/replace JOptionPane in one class with a separate JavaFX Class

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
//How can I call the JavaFXGUI class in the JavaTestDriver class? I have tried keywords "start" and "launch" and tried to create a blank method in the JavaFXGUI class and then trying to call the method. The two classes work separately, but I cannot seem to get the JavaTestDriver class to call the JavaTestGUI class. The class I am trying to call from has an exception, but I don't know if that would affect anything. I would like to replace the JOptionPane input of the 3 variables with the JavaFX input of the 3 variables which is in a seperate class. Any help or point in the right direction would be appreciated. I am new to programming.



 
Marshal
Posts: 76867
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have added code tags to your post; always use the,. Doesn't it look better. They do however highoight the incorrectly formatted comments. For comments longer than about ½ line use /* comments */ and make sure to restrict the line length. I shall have a go at correcting that later.
Don't throw plain Exception. If you don't want negative numbers throw an IllegalArgumentException and don't use a throws clause. Describe the Exception in the /** documentationcomments */ however. No, the possibility of throwing an Exception should not make any difference to your problem.
You never call a class. You call methods of its instances. There are no such things as start and launch keywords. Do you mean method names? Do you know how to create an instance of that JavaFXGUI class?
 
Moe Heinz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! I would like to use the JavaTestGui class to let the user input information, use that information in the JavaTestDriver class instead of using the JOption.Pane. What would that be called?
 
Campbell Ritchie
Marshal
Posts: 76867
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Creating an object of that class is more fundamental. Show us how you did that.
 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic