Servis-Rhino 4211B Guia do Utilizador Página 286

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 298
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 285
new components. Here is a skeleton class for just a component. This class both loads the FXML to
create the meat of the component as well as acting as the controller for the component. In order to
use it we should:
Rename the class to be the name of the component we wish to define.
Point to the correct FXML file
Do not include a controller definition in the FXML file
Define the root of the FXML file as <fx:root>
package com.kolban;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.layout.AnchorPane;
/**
*
* @author Neil Kolban ([email protected])
* @version 2014-05-04
*/
public class SampleComponent extends AnchorPane {
/**
* General constructor for this component.
*/
public SampleComponent() {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("fxml/SampleComponent.fxml"));
fxmlLoader.setRoot(this);
fxmlLoader.setController(this);
try {
fxmlLoader.load();
} catch (Exception e) {
e.printStackTrace();
}
} // End of SampleComponent
/**
* Initialize the component.
*/
@FXML
private void initialize() {
// Code here
} // End of initialize
} // End of class
// End of file
JavaFX 3
rd
Party Packages
ControlsFX
ControlsFX is a collection of components for JavaFX. It can be found here:
http://fxexperience.com/controlsfx/
org.controlsfx.dialog.Dialogs
Arguably one of the most compelling features of this package is the rich set of dialogs that it
provides. To best understand the dialog, imagine it broken into a set of parts:
title – The area on the title bar of the dialog
Page 286
Vista de página 285
1 2 ... 281 282 283 284 285 286 287 288 289 290 291 ... 297 298

Comentários a estes Manuais

Sem comentários