Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are using fxml, then you could create a separate fxml file and associated Controller class for each panel. This will separate the view from logic within a panel and separate each panel's view and logic from every other panel.</p> <p>The trick then becomes when you need to actually share data between panels - for example a change user form needs to be informed of the user to be changed. In this case you need to have some kind of context information. Different ways to do this are to:</p> <ol> <li>Use a global store (similar to a server's http session).</li> <li><a href="http://www.zenjava.com/2011/10/23/javafx-2-0-fxml-and-spring/" rel="nofollow noreferrer">Integrate a dependency injection framework</a> such as guice, spring or CDI.</li> <li>Create <a href="https://stackoverflow.com/questions/14511016/how-can-i-use-a-variable-from-another-controller-in-javafx">management services</a> which control passing data between panels.</li> <li>Use an <a href="http://code.google.com/p/guava-libraries/wiki/EventBusExplained" rel="nofollow noreferrer">event bus</a> style system for sharing data.</li> <li>Implement <a href="https://github.com/brunoborges/webfx" rel="nofollow noreferrer">your application like a html style web app</a> with server managed state.</li> <li>Use a framework like the now (unfortunately) defunct <a href="http://www.zenjava.com/jfx-flow/" rel="nofollow noreferrer">jfxflow</a>.</li> </ol> <p>For simple applications, I'd go with - "Create management services which control passing data between panels", using the following <a href="https://gist.github.com/4631319" rel="nofollow noreferrer">simple project as a template</a>. The project template is a program where the "First panel of program is login page and the next page depends on the inserted login".</p> <p>If you are using plain Java and no fxml, you could look at how some other Java projects which don't use fxml are organized and organize your projects similarly. For example, the <a href="http://www.oracle.com/technetwork/java/javafx/samples/index.html" rel="nofollow noreferrer">JavaFX Ensemble App</a>, the <a href="http://code.google.com/p/willow-browse" rel="nofollow noreferrer">willow browser</a> and the JavaFX Henley Sales Data App (which is downloadable as part of the same sample code package as the Ensemble App). Reviewing the Ensemble source code is probably a good place to start.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload