Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • 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: 75673
354
  • 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: 75673
354
  • 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.
 
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic