/* * Created on May 5, 2012 */ package mytests; import java.io.*; import javafx.application.*; import javafx.fxml.*; import javafx.scene.control.*; import javafx.stage.*; /** * @author mifeld */ public class MenuItemErrorTest extends Application { @Override public void start(Stage stage) throws Exception { MenuItem mi = load("mytests/MenuItemErrorTest.fxml"); System.out.println("Id = "+mi.getId()); } public static void main(String[] args) { Application.launch(args); } private static T load(String id) { ClassLoader cl = GridPaneTest.class.getClassLoader(); try ( InputStream is = cl.getResourceAsStream(id); ) { FXMLLoader loader = new FXMLLoader(); Object res = loader.load(is); return (T)res; } catch(IOException e) { e.printStackTrace(); return null; } } }