0

I am creating a Java program that displays several graphs based on user input. I have created two JavaFX Application classes for two different styled graphs (Barchart and Piechart). I am now creating a main application class that will contain my full UI. From this class, I want to call the graph classes based on user input (ie when you click on the "display bar chart" button, the associated method will call the Barchart application class). Is this possible?

The classes are as follows: Main UI: ChangeSolutions.java Bar graph: CATGraph.java Pie chart: Quarterly.java

Nats
  • 11
  • 4
  • Are all of these standalone applications or are the graphs UI widgets? The first approach will make your life difficult, the second one is easier (and in most cases preferred) – UnholySheep May 02 '17 at 10:29
  • Currently they are standalone applications. Do you know where I can find an example of running a graph as a widget? – Nats May 02 '17 at 10:35
  • The `Application` class represents the entire application, and so you should only have one `Application` class in your application. Code in the `Application` class is inherently not reusable in other applications, so if you want to reuse code, that code should be placed in other classes. See http://stackoverflow.com/questions/32464698/java-how-do-i-start-a-standalone-application-from-the-current-one-when-both-are – James_D May 02 '17 at 11:05

0 Answers0