0
public class jfxApp extends Application{

}

Can I extend the jfxApp I created like this?

public class newApp extends jfxApp{

}
Eli Sadoff
  • 7,173
  • 6
  • 33
  • 61
  • 1
    Yes you can, but your class names should being with uppercase letters. – Eli Sadoff Nov 02 '16 at 20:38
  • or is it possible to create javafx panes like gridpane without extending Application class? Which metttans you can now create an instance of it in the main class in which you extend the application class – Gbenga Ogunbule Nov 02 '16 at 20:41
  • 1
    Yes, you can extend another Java Object - did you try it? – blurfus Nov 02 '16 at 20:44
  • You can, but I'm not sure what the point would be. The major use of an `Application ` subclass is as the startup of your JavaFX application; that is specifically implemented by the `start()` method. If you override your existing `start()` method you may as well just create a new `Application` subclass. If you don't override it, it's essentially going to be the same application, unless you are doing something moderately sophisticated. Can you explain what you're actually trying to achieve? – James_D Nov 02 '16 at 20:55
  • I have written over one thousand lines of code in a single javafx class and more codes are needed and I think it would be better to have each page or categories to have is own class – Gbenga Ogunbule Nov 02 '16 at 21:08
  • another option which I think is to create different classes for different categories and later instanciate them inside the main class – Gbenga Ogunbule Nov 02 '16 at 21:11
  • Well yes, obviously you should split them into different classes. But those other classes shouldn't be subclasses of `Application` – James_D Nov 02 '16 at 22:06
  • See my answer to http://stackoverflow.com/questions/32464698/java-how-do-i-start-a-standalone-application-from-the-current-one-when-both-are (or many other examples) for examples of how to break your application into separate classes. – James_D Nov 03 '16 at 01:00

1 Answers1

0

Yes, you are able to extend something that is already extending something. It will give you access to all methods in jfxApp, Application and newApp.