Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Moe Heinz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.



 
Campbell Ritchie
Marshal
Posts: 55672
161
  • Mark post as helpful
  • send pies
  • 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
  • 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: 55672
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Creating an object of that class is more fundamental. Show us how you did that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!