JavaFX pop up using seperate fxml file

I have been scanning the forums and cannot find the solution I need, so apologies if this is a repost.
I have created an application in SceneBuilder, and want to call a pop up (also created separately in scene builder) when a certain button is pressed.
How?

I use something similar to the following because I want to access methods of the sub window's controller :
FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/my/javafx/Stuff.fxml"));
Parent root = (Parent) loader.load();
MyStuffController controller = (MyStuffController) loader.getController();
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.setScene(scene);
stage.setTitle("My Window");
stage.show();
You can also do it like this
FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/my/javafx/Stuff.fxml"));
Parent root = (Parent) fxmlLoader.load();
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.setScene(scene);
stage.setTitle("My Window");
stage.show();
if you want more of a popup feel, you can use other options to style the window and make it unmovable
stage.initModality(Modality.APPLICATION_MODAL);
stage.initStyle(StageStyle.UNDECORATED);

Similar Messages

  • I am not able to use two backing files in same portal page

    hi to all
    i am using backing files in remote portlet.
    but i have two portlets in my portal page and in both i need to use backing files. i used seperate backing files for both the portlets but only one works at a time.
    please help me out frnds..
    did this happening because of same object MarkupRequestState.KEY..... following is code that i am using. similar code used for another portlet, just a change of state varible and parameter variable
    am i missing something?
    package backempno;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.bea.netuix.servlets.controls.content.backing.AbstractJspBacking;
    import com.bea.wsrp.ext.holders.MarkupRequestState;
    import com.bea.wsrp.ext.holders.SimpleStateHolder;
    public class sendempno extends AbstractJspBacking
    public boolean preRender(HttpServletRequest request,HttpServletResponse response)
    SimpleStateHolder state2 = new SimpleStateHolder();
    String empno=request.getParameter("empno");
    state2.addParameter("empno",empno);
    request.setAttribute(MarkupRequestState.KEY, state2);
    return true;
    }

    Hi Susan,
    In that case I will recommend that you consult a local technician/IT team and see if there is some network connectivity issue with your machine.
    - Abhishek Maurya

  • Is it possible to use my music files in both my girlfriend's and my separate Itunes libraries through our seperate user accounts?? I want to import my music into her library with out copying the files onto my hard drive a second time....

    Is it possible to use my music files in both my girlfriend's and my Itunes library's through our seperate user account?  I want to import my music into her library without copying to my hard drive a second time.....

    Would any of these help you?:
    http://www.apple.com/itunes/inside-itunes/2011/05/two-ways-to-share-media-librar ies-through-itunes.html
    http://www.apple.com/itunes/inside-itunes/2011/01/keeping-multiple-itunes-librar ies-on-a-single-computerif-you-share-your-computer-with-others-and-you.html

  • Using iDVD, I've no problem creating a slideshow, but I want to add three seperate sound files, in this case speeches I've got in iTunes. I want to create three individual buttons/sub menu to access them individually from the photos. Can anyone help

    Using iDVD I've no problem creating a slideshow, but am having problems trying to add three seperate sound files in this case three speeches that I hold in iTunes. I want to be able to access them individually and seperately from the photo slideshow. Can anyone advise if this can be done and if it can, how I go about creating the seperate menu and buttons.

    If you'd like to integrate the speeches with the slideshow, I'd do that in iMovie where you'll have more control over the timing.  Use chapter markers at the beginning of each speech so the viewer can jump to a particular speech (note that chapter markers advance the viewer to a particular spot -- the viewer keeps watching the rest of the video until the end of everything or until they use the remote's menu button).
    If you're just wanting the speeches to be on the DVD so people can listen to the speeches after seeing your slideshow, you could:
    - use iDVD or iMovie to make a "slideshow" with just 1 image matching the length of a speech.
    - create three submenus and use the speeches as menu music.  Here's a (random) video on creating submenus:
    http://www.youtube.com/watch?v=DlhQSb_D5kc
    John

  • Refering FXML file element into Main class in Javafx

    Hi,
      Is it possible to refer FXML file elements or components  in main class in javafx?
       if possible then how?

    Typically you define a controller class to interact with the UI components. You can inject components into the controller by defining them as fields annotated with @FXML, and then define a fx:id attribute for those elements in the FXML file with attribute values matching the variable name in the controller class. There's a example in the "Adding Rows to the Table" section of the FXML tutorial.

  • I recently downloaded DOSBOX (a DOS emulator). I have since uninstalled the file and removed it from my download history, yet every time I use Firefox, I get a pop-up to save the file (re-download) again. How do I fix it?

    I recently downloaded DOSBOX (a DOS emulator). I have since uninstalled and removed the file from my system, yet every time I access the net, I get a pop-up to save the file (re-download) again. How do I fix it?

    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Creating a new FXML File (Eclipse IDE) cannot finish

    Following steps on: http://docs.oracle.com/javafx/scenebuilder/1/use_java_ides/sb-with-eclipse.htm#BABBFEBD
    5. In the FXML File dialog box, complete the creation of the new FXML document using the following steps:...
    I get the panel to fill in but no matter what I enter for the Source folder, Package or name. When I click on Finish nothing happens - no error, popup etc.
    The example also shows Root Element (default):
      If not already set, specify the FXML document's root element by clicking Browse and selecting an item from the Find Preloader dialog box. The default value shown is AnchorPane.
    This field is blank and clicking the drop down values are blank - Browse doesn't do anything, similar to Finish, it's enabled but doesn't do anything.
    Any suggestions or fixes for the tutorial?
    The other steps seem to be working up till this point. Thanks.

    richardb wrote:
    Hello forum,
    I have restored an online backup using a third party tool along with the control file. I need to bring this backup into service under a different database name. I already had a database with the new name in place so I am using that pfile.
    When I try to mount the database I get the error ORA-01103: database name 'EDRMS' in controlfile is not 'EDRMSTST'
    However, if I edit the pfile and set the database name to EDRMS I get the following errors in the alert log:
    ORA-09341: scumnt: unable to mount database
    OSD-04400: unable to acquire internal semaphore for process
    O/S-Error: (OS 183) Cannot create a file when that file already exists.
    I think these errors arise because the EDRMS database is running on the server at this time.
    I believe I have to recreate the control file to have the new database name, i.e. EDRMSTST but how can I start that process if the database will not mount?
    - Regards,
    Richardrealize we only know what you post; which is scant to say the least.
    We don't know what you did that threw the posted error.
    We don't even know OS name or version.

  • How to organize the import statements in FXML Files?

    Hello,
    I'm a user of NetBeans IDE and it can organize the import statements in *.java files. Now, I'm using JavaFX and editing the *.fxml files as well. I want to know how to organize the import statements in *.fxml files?
    Thanks a lot.

    You should use Scene Builder, it will make all these import statements for you.
    Moreover, it will greatly simplify the writing of your FXML files, since you only have to Drag&Drop JavaFX objects on the scene. Then, it automatically generates FXML files.

  • Can not open FXML files in DataApp example

    Hi,
    I download javafx_samples-2_2_0-windows.zip and unzip, and open DataApp project. I build and run, it's ok.
    but I cannot open many fxml files, for example, it gives me following error messages:
    Error loading file 'C:/work/tianqing/Java/JavaFX/TestProjects/DataApp/DataAppClient/src/com/javafx/experiments/dataapp/client/livetab/live-tab.fxml'.
    C:\work\tianqing\Java\JavaFX\TestProjects\DataApp\DataAppClient\src\com\javafx\experiments\dataapp\client\livetab\live-tab.fxml:0: error:
         java.lang.ClassNotFoundException: com.javafx.experiments.dataapp.client.map.UnitedStatesMapPane
    Could anybody tell me why?
    I'm using Netbeans 7.2 and my java version is "1.7.0_07".
    Thanks very much!
    Terry

    Hi,
    I believe that's caused by one of the bugs mentioned in SceneBuilder 1.0 release notes. When you open an FXML file that contains custom types - such as com.javafx.experiments.dataapp.client.map.UnitedStatesMapPane, SceneBuilder should popup a dialog window - prompting you to enter a classpath from which to resolve these types. Unfortunately, this popup is not displayed when you open an FXML file from NetBeans or by double clicking on the FXML file from the file system.
    Sometimes SceneBuilder will open - but all custom types will be hidden - sometimes you will get a ClassNotFoundException (depending on how the custom type was imported).
    Fortunately there's a work around: start SceneBuilder by double clicking on SceneBuider's icon - instead of double clicking on an FXML file. Then use "File > Open..." from within SceneBuilder to open your file.
    Hope this helps,
    -- daniel

  • CSS Image loading problem by dynamically loading from fxml file?

    h1. Introduction
    The application I am developing loads an FXML file from a Controller. The FXML uses CSS and images for buttons are set in the CSS.
    CSS directory structure
    <package>.fxml
    Images
    <package>.fxml.resources.<subdir>
    Example CSS Code
    .buttonImage {
        -fx-background-image: url("resources/subdir/image.png");
    }Example loading fxml from controller code
             URL location = getClass().getResource("/package/fxml/UI.fxml");
             FXMLLoader fxmlLoader = new FXMLLoader(location);
             fxmlLoader.setLocation(location);
             fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
             Parent root = (Parent)fxmlLoader.load(location.openStream());
             Controller = (Controller) fxmlLoader.getController();
             newPane.getChildren().add(root);h1. Problem
    The fxml file does not load and causes the following error:
    javafx.fxml.LoadException: Page language not specified.Note, the fxml file loaded correctly before images were added.
    Any ideas of what might be going wrong?
    h1. Attempted
    I have attempted the following: tried changing the url of the image as an absolute path.

    No Problem: Note, this is the actual FXML, my previous examples were simplifications of package names and class names in order to directly illustrate the problem. Note, I am using SceneBuilder to develop the FXML file.
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.net.*?>
    <?import java.util.*?>
    <?import javafx.collections.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.text.*?>
    <AnchorPane id="AnchorPane" prefHeight="396.0000999999975" prefWidth="350.0" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml" fx:controller="com.monkygames.kbmaster.controller.ProfileUIController">
      <children>
        <Label layoutX="14.0" layoutY="14.0" text="Profiles">
          <font>
            <Font size="18.0" />
          </font>
        </Label>
        <GridPane layoutX="15.0" layoutY="44.0" prefHeight="99.0" prefWidth="335.0">
          <children>
            <Label text="Type: " GridPane.columnIndex="0" GridPane.rowIndex="0" />
            <ComboBox fx:id="typeCB" prefWidth="249.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
              <items>
                <FXCollections fx:factory="observableArrayList">
                  <String fx:value="Item 1" />
                  <String fx:value="Item 2" />
                  <String fx:value="Item 3" />
                </FXCollections>
              </items>
            </ComboBox>
            <Label text="Program: " GridPane.columnIndex="0" GridPane.rowIndex="1" />
            <ComboBox fx:id="programCB" prefWidth="249.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
              <items>
                <FXCollections fx:factory="observableArrayList">
                  <String fx:value="Item 1" />
                  <String fx:value="Item 2" />
                  <String fx:value="Item 3" />
                </FXCollections>
              </items>
            </ComboBox>
            <Label text="Profile: " GridPane.columnIndex="0" GridPane.rowIndex="2" />
            <ComboBox prefWidth="249.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
              <items>
                <FXCollections fx:factory="observableArrayList">
                  <String fx:value="Item 1" />
                  <String fx:value="Item 2" />
                  <String fx:value="Item 3" />
                </FXCollections>
              </items>
            </ComboBox>
          </children>
          <columnConstraints>
            <ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" maxWidth="-Infinity" minWidth="10.0" prefWidth="80.0" />
            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
          </columnConstraints>
          <rowConstraints>
            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
          </rowConstraints>
        </GridPane>
        <HBox layoutX="14.0" layoutY="150.0" prefHeight="159.0" prefWidth="335.0">
          <children>
            <Label text="Description: " />
            <TextArea prefHeight="172.0" prefWidth="247.0" wrapText="true" />
          </children>
        </HBox>
        <HBox alignment="CENTER" layoutX="11.0" layoutY="334.0" prefHeight="48.0" prefWidth="329.0">
          <children>
            <Button fx:id="newProfileB" contentDisplay="GRAPHIC_ONLY" minHeight="48.0" minWidth="48.0" mnemonicParsing="false" onAction="profileEventFired" prefHeight="48.0" prefWidth="48.0" styleClass="newProfile" text="New Profile" />
            <Button id="newProfileB" fx:id="cloneProfileB" contentDisplay="GRAPHIC_ONLY" minHeight="48.0" minWidth="48.0" mnemonicParsing="false" onAction="profileEventFired" prefHeight="48.0" prefWidth="48.0" styleClass="cloneProfile" text="Clone Profile" />
            <Button id="newProfileB" fx:id="importProfileB" contentDisplay="GRAPHIC_ONLY" minHeight="48.0" minWidth="48.0" mnemonicParsing="false" onAction="profileEventFired" prefHeight="48.0" prefWidth="48.0" styleClass="importProfile" text="Import Profile" />
            <Button id="newProfileB" fx:id="exportProfileB" contentDisplay="GRAPHIC_ONLY" minHeight="48.0" minWidth="48.0" mnemonicParsing="false" onAction="profileEventFired" prefHeight="48.0" prefWidth="48.0" styleClass="exportProfile" text="Export Profile" />
            <Button id="newProfileB" fx:id="printPDFB" contentDisplay="GRAPHIC_ONLY" minHeight="48.0" minWidth="48.0" mnemonicParsing="false" onAction="profileEventFired" prefHeight="48.0" prefWidth="48.0" styleClass="pdfProfile" text="Print to PDF" />
            <Button id="newProfileB" fx:id="deleteProfileB" contentDisplay="GRAPHIC_ONLY" minHeight="48.0" minWidth="48.0" mnemonicParsing="false" onAction="profileEventFired" prefHeight="48.0" prefWidth="48.0" styleClass="deleteProfile" text="Delete Profile" />
          </children>
        </HBox>
      </children>
      <stylesheets>
        <URL value="@master.css" />
        <URL value="@profile.css" />
      </stylesheets>
    </AnchorPane>Edited by: 960799 on Jan 4, 2013 8:58 PM
    Edited by: 960799 on Jan 4, 2013 8:59 PM

  • TS3212 I just installed iTunes (from the apple site) on to my new laptop.  When I click on the icon to open I get a pop up that says "The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes".  Now what do I do and ho

    I just installed iTunes on my new laptop.  When I click on the desktop icon I receive a pop up that says "The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes".  I have no idea what this means or what to do about it.  I can't even find a file on my computer like the one referred to in the pop up.  I am currently considering keeping my old laptop if it is the only way for me to continue to access iTunes.  What should I do to fix this?

    What version of iTunes are you using? An .itl file is something that Windows uses, or very old versions of iTunes on Mac. The library file on Macs is now .xml and has been since late iTunes 4.
    Is iTunes running ok without any problems after you OK that message? If it is, then you may be able to ignore it if you can't account for why you're getting it. But make sure you take backups in case something happens in the future.

  • How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?

    Greetings all,
    I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
    We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
    The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
    For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
    There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
    I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
    PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
    var myPresets = app.pdfExportPresets.everyItem().name;
    myPresets.unshift("- Select Preset -");
    var myWin = new Window('dialog', 'PDF Export Presets');
    myWin.orientation = 'row';
    with(myWin){
        myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
        myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
        myWin.myPDFExport.selection = 0;
        myWin.btnOK = add('button', undefined, 'OK');
    myWin.center();
    var myWindow = myWin.show();
    if(myWindow == true && myWin.myPDFExport.selection.index != 0){
        var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
        myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
        if(myFile != null){
            app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
        }else{
            alert("No File selected");
    }else{
        alert("No PDF Preset selected");
    So far my code does the following:
    1) Runs the Multi-Page PDF Import Script
    2) Runs PDF Export Script Above
    3) Toggles the Template
    4) Runs #2 Again
    5) Deletes the imported PDF and all pages and toggles template again.
    It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
    Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!

    If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
    Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
    It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.

  • In Firefox, using gmail, 'Attach Files' no longer works.

    Am using FF 31.0, and when entering gmail I can no longer use the 'Attach Files' button after composing an email. I can drag and drop, but when sending jpgs it fills the recipients window with large graphics - which isn't useful.
    Logging into Chrome or IE and it works just fine - so I know it's solely a FF issue. Have also tried it on another PC with exactly the same response, so I know it's not my PC either. I've tried with all addons disabled, no difference, and the other PC isn't running any addons anyway.

    Try allowing pop up windows
    Open Menu
    Options
    Content (on the top)
    Click Exceptions...
    Type mail.google.com in address of website area
    Click Allow
    Try to open attachment window now.
    Restart FireFox and try adding attachment again.

  • Whenever I click on the Itunes icon, a window pops up saying that `The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes`.  I then click ok and the pop up vanishes.  Any ideas as to what I should do?

    Whenever I click on the Itunes icon, a window pops up saying that `The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes`.  I then click ok and the pop up vanishes.  Any ideas as to what I should do?

    What version of iTunes are you using? An .itl file is something that Windows uses, or very old versions of iTunes on Mac. The library file on Macs is now .xml and has been since late iTunes 4.
    Is iTunes running ok without any problems after you OK that message? If it is, then you may be able to ignore it if you can't account for why you're getting it. But make sure you take backups in case something happens in the future.

  • Use of .pdf file in report

    Hello,
    is it in any way possible to use an existing pdf file or page in report or include it in the pdf generation?
    Tijs

    Brad,
    This indeed seems to be the only way to fulfill my need as the PDF files I need to add are pre existing and I'd like the complete report be generated by Diadem 'with one push of a button'.
    After some minimal research I think I can get everything working as I would like using Ghostscript to convert any required PDF file to seperate PNG files and then load its pages.
    I currently use:
    Call ExtProgram ("C:\Program Files\gs\gs9.14\bin\gswin64c", "-dSAFER -dBATCH -dNOPAUSE -r200 -sDEVICE=png16m -dGraphicsAlphaBits=4 -sPAPERSIZE=letter -sOutputFile=D:\Drop\Temp\PNG-%d.png D:\Drop\Temp\PDF.pdf")
     I have tried to get a variables within this command for the input and output files and locations but couldn't get it to work so as is I'll have to shuffle files around to be able to use this rigid approach. If there is any way to get a variable within this code it's use would be a lot easier.
    As the external program is called the script continues without knowing when the required info (files) is available. To prevent using a fixed pause time I tried to use a small pause and compare filesize before and after pause to determine if a file is fully available, Unfortunately this doesn't realy work as well as I hoped. Also I guess that used h/w and other processes running at the same time would effect what pause time to  use. I might have to find another way to see if a file is generated completely but I'll quote anyways:
    Do
    k= FileSize (Wrkdir & "PNG-"&i&".png")
    Call Pause (0.3)
    Loop Until (k=FileSize (Wrkdir & "PNG-"&i&".png"))
     Although the script now does what it needs to do there is some shuffeling of files required because of the rigidity in the call to the external program and to keep it reliable longer than required pause times are needed.
    The realisation of a function that will insert existing Pdf files(pages) is becoming within grasps If I can get around these 2 minor issues.
    Tijs

Maybe you are looking for