How can I create events dynamic for a Group/List?

Hey,
atm I'm programming a little application where i want to add elements to my center-pane.
Simpyfied I got:
- Center Pane : here shall the elements appear on right click in bottom-pane. This pane shall be used as anything like a playground where you can drag/drop and connect items from the bottom-pane
- Bottom Pane: here I got about 180 elements which are quite equal. This is sth like a menu of items which you can use. I realised them in java classes extended from a parent class with differend calulations.
What I want:
I want to create an event handler for EACH of the "menu" elements dynamically. Just sth like:
    for (int i = 0; i < basic_menu_list.size(); i++)
      final Element el = hbox_bottom.getChildren().get(i);
      hbox_bottom.getChildren().get(i).setOnMouseClicked(new EventHandler<MouseEvent>()
        public void handle(MouseEvent event)
          if (event.isSecondaryButtonDown())
            playground.add(el);
            redrawPlayground();
    }But as i expected this doesnt work...
Now my question:
How can I solve this problem? Is there any option to listen to all elements of a group without hard-coding every single listener?
Thanks for your help,
Martin

Hello User,
Why did you expect that it wouldn't work?
You have an example with "transition" apply on a bunch of circles in the Getting Started with JavaFx (http://download.oracle.com/javafx/2.0/get_started/jfxpub-get_started.htm)
Here a basic example class...
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.TextBox;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class HelloWorld extends Application {
    //~ ----------------------------------------------------------------------------------------------------------------
    //~ Methods
    //~ ----------------------------------------------------------------------------------------------------------------
    public static void main(String[] args) {
        // Entry point
        Application.launch(args);
    @Override
    public void start(Stage mainStage) throws Exception {
        Pane pane = new Pane();
        Scene scene = new Scene(pane, 200, 200);
        VBox vBox = new VBox();
        TextBox input1 = new TextBox();
        TextBox input2 = new TextBox();
        vBox.getChildren().addAll(input1, input2);
        for (Node input : vBox.getChildren()) {
            input.setOnMouseClicked(new EventHandler<MouseEvent>() {
                    public void handle(MouseEvent event) {
                        System.out.println("test click");
        pane.getChildren().add(vBox);
        mainStage.setScene(scene);
        mainStage.setVisible(true);
}Niculaiu

Similar Messages

  • How Can we create parameter field for BP Group on Crystal Report

    Hi,
    I have something wrong:
    I want to create parameter field on Crystal report to select multiple cardcode group, I use for that :
    @Select * from ocrg
    but when I execute the report the fiel don't give any thing to choice BP Group, it is a null fiel ?
    Any Idea how can I do this otherwis
    Ps: I want to precise group to display it.
    Thanks in advance
    Cdt
    Malika

    Hi Malika.....
    Try this simple query report in Crystal with Parameter as CardGroup....
    Select T0.CardCode, T0.CardName From OCRD T0
    Where T0.GroupCode='{?GroupCode@Select * from OCRG}'
    Take above query in command window.
    GroupCode@Select * from OCRG
    Take above condition in parameter window and then try to run in SAP.
    You can see how CFL gets generated and you get values of CardGroup......
    The above is only example.......
    Regards,
    Rahul

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • How can I create a form for users wherein the text field will expand to accommodate additional text?

    How can I create a form for users wherein the text field will expand to accommodate additional text?

    You need to use LiveCycle (PC Only) to create a dynamic form like that.
    The best you can do with Acrobat to view all of the text in a field is to set the field to multiline, and set the size to "Auto" (If you don't set the size to 'Auto', you can enter as much text as you wish, but the user will need to use the scrollbar to view all of the text.)

  • How can I create a URL for a PWA for MS Project Server 2010 project file that includes the view?

    Hi, this question has been answered for 2013. The answer here suggests that it can be done in  2010.
    See:
    http://social.technet.microsoft.com/Forums/projectserver/en-US/3affdc4f-36bf-4381-8b75-27c73465efd4/action?threadDisplayName=how-can-i-create-a-url-for-a-pwa-for-ms-project-server-2013-project-file-that-includes-the-view
    Who knows how?
    Regards
    Sander

    Hi Sander,
    As far as I tested it, it is not possible either with PS2010. The URL only contains the PDP name and the projUID.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • How can i create a Trash for external USB Drives ?

    Hello,
    how can i create a Trash for external USB Drives or my TimeCapsule ?
    Thanks.

    You do not need to create trash cans for individual drives.  The trash can on the desktop holds deleted files from all mounted drives.
    TimeCapsule manages its own space.  If it fills up it will delete older backps to make space for newer ones.

  • How can mass create batch classification for many material batches? ?

    Hi Experts,
    In our system , there are so many material batches which have not been classified,see by
    BMBC Tcode.
    That means these batches has no values in the batch class. I know we can create
    classification for these batches with MSC2N Tcode.
    But there are so many batches  which have not been classified,more then 2000.
    It is not possible to create classification for every batch with with MSC2N once a time.
    So how can I create batch classification for so many batches once a time?
    How can I mass create batch classification for so many batches??
    Thanks for any reply!

    Hi,
    Please be aware that SAP does not support the use of batch
    input in the classification system. SAP recommends you use BAPI's for
    example in your case BAPI BAPI_OBJCL_CREATE and BAPI_OBJCL_CHANGE
    would be able to help. For more information, please have a look at the
    note: 943559 - Point 2 and 13. Point 13 references the note 1083986.
    I hope this helps!.
    Best Regards,
    Arminda Jack

  • How can i create apple id for i tune store

    how can i create apple id for i tune store?????

    Since you're posting here, you already have an Apple ID. Use it to sign into the iTunes Store.
    (81019)

  • How can I create an EntityStore for a Database?  Advice on DB strategy?

    Hello All,
    How can I create an com.sleepycat.persist.EntityStore for a com.sleepycat.db.Database? Advice on DB strategy?
    I'm looking to create an application prototype that creates a database dynamically and can delete it programatically. Is openDatabase/removeDatabase what I'd want to use for that?
    So far, the Direct Persistence Layer is an amazing piece of technology and has the potential to make my team's application faster than we every though possible, so kudos to the author.
    I've built a high-security application using the DPL and a single database for hundreds millions of users. I'd like to attempt to create a database for each user for security and manageability purposes. Our mission statement doesn't allow us to execute queries for sensitive data across more than one user account at a time, so I don't get any benefit from having every user's objects in a single database. I'm investigating if giving each user their own database will speed up insert times and SecondaryIndex queries. It'll certainly be more secure as each database will be encrypted with a unique password.
    My design is that I have an app with dozens of com.sleepycat.persist.model.Entity beans which I persist and query on their Primary and secondary indexes. I've been accessing things through an EntityStore as illustrated in the Getting Started Guide. Can I access a database created with openDatabase through an EntityStore and com.sleepycat.persist.PrimaryIndex?
    Thanks in Advance,
    Steven
    Harvard Childrens Hospital Informatics Program

    I closed this as I found another way to solve my issue.
    Thanks,
    Steven

  • How can I create classes dynamically?

    Guys
    My requirment is I want to create classes and their instancess too dynamically. First is it possible in Java?
    If so, then my next question is how can I refer such dynamically created classes in my code to avoid compilation error.
    Thanks in advance
    Regards
    Sunil

    For other ways to generate classes on runtime you could also have a look at BCEL:
    http://jakarta.apache.org/bcel
    And dynamic proxies:
    http://java.sun.com/j2se/1.4.2/docs/guide/reflection/proxy.html
    If so, then my next question is how can I refer such
    dynamically created classes in my code to avoid compilation
    error.Generally the classes that you load should either implement some interface or extend some abstract class you know of at compile time so that the compiler knows what methods are available for use. If that's not possible you can only use reflection.

  • How can I create a Title for the worksheet in Discoverer Plus

    Dear members,
    I am using discoverer 4i Plus to create workbooks. I am not finding an option to insert a title for the worksheet. In Discoverer Desktop we have a separate option to insert or edit a title. I am not sure how can we create titles in Plus.
    Any suggestions.
    Thanks
    Sandeep

    Hi,
    I am not able to login to Discoverer Desktop Using my Applications username. My Desktop Version is 4.1.37. The same username works in Discoverer 4i Plus and i can create workbook there.
    I went to Tools--->Options--->Connections and checked the option connect to both standard and application EUL's and while i am logging in i checked the small box which comes in the login screen. I do not know why this happening.
    I am also able to login as the database user in Desktop but not as an application user.
    I want to login into desktop as an application user and create a template workbook which has title and then assign that workbook to a particular responsibility since creating title cannot be done in Plus.
    I am not sure what's going wrong here because the Desktop works for database user but not for an application user. Any comments are highly appreciated.
    Thanks
    sandeep

  • How can I create a object for a note?

    Hi experts,
        I need to apply the note 501905 but when I try in the SNOTE transacction I receive this error:
    Object REPS Z_MRM_DELETE_PP does not exist; create it
    Diagnosis
    The SAP Note that you want to implement contains changes to an object that does not yet exist in your system.
    SAP Notes contain only changes to objects that already exist. This means that the the system cannot automatically create new objects during the implementation of this SAP Note.
    Procedure
    1. Cancel the SAP Note implementationl.
    2. Create an empty object REPS Z_MRM_DELETE_PP with the corresponding object editor.
    3. Restart the SAP Note implementation.
    How can I create that Object??
    Thanks for the help!

    Hi Carlos,
    It says that you have to create a new program with a name Z_MRM_DELETE_PP.
    Once you create and activate the program you can execute the SAP Note.
    All this processure will be written in the SAP Note.
    Please Go through the Note using below:
    Step1: Use T.code SNOTE.
    Step2: Use menu GOTO --> NOTE BROWSER. Provide the Note no and EXECUTE.
    Step3: Double click on the displayed line.
    Here you will get the information to do before implementing the note.
    Go through all the documentation, and once you did all the development given in the note then you can implement the note.
    Regards,
    Sreekanth.

  • MRRL : How can we create Credit Memo for these Invoices

    Hi Gurus,
    How can we create Crerdit memo in case when the Invoice has been posted thru MRRL?
    Is there any way the we can do Subsequent Credit / debit for the ERS vendor (posted by MRRL) as well?
    Thanks in advance
    Shashidhar

    Hello
    How can we reverse fi document created through MRRL transaction.
    FI document cannot be reversed reason being -Error-Invoice doc. 5105692828/2009 was created via evaluated receipt settlement.
    GR material document cannot reversed reason being-Error-Deficit of PU IR quantity 1,456.000 CS
    Not possible even to return the delivery to Vendor , Movement type 122
    Thanks
    Dinabandhu

  • How can I create a dynamic Dropdownlist

    Hi Experts,
    I am new in the adobe forms and I have this problem.
    I am working on a Dropdownlist in Adobe Interactive Form. In my case, my form will be used in Offline-ABAP system without any web dynpro application.
    I have an internal table containing some values like this (number of rows depend on what is store on the database dynamic)
    A0  Dropdownlist1
    A1    Dropdownlist2
    A2    Dropdownlist2
    B0 Dropdownlist1
    B1    Dropdownlist2
    B2    Dropdownlist2
    B3    Dropdownlist2
    B4    Dropdownlist2
    C0  Dropdownlist1
    C5    Dropdownlist2
    C6    Dropdownlist2
    C7    Dropdownlist2
    I would like to create 2 dropdownlist. to be as follows:
    The first dropdownlist must have for example the values A0, B0, C0 .
    When the user select for example B0 from the Dropdownlist1, then dropdownlist2 must have only the value B1, B2, B3 and B4.
    How can i do that as I have seen the example in the purchase order (country and state).
    My requirement is that, the value must be dynamic, that means i must select the value from the SAP-Database into internal table and bind it to my dropdownlist.
    Thanks and Regards.
    mishak

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

  • How can i create a dynamic structure based on my input from a select-option

    Hello,
    This is to develop a custom report in FI for G/L Balance based on company code.
    I have an input select-option for Company code.
    Based on the range of company code my output layout should be modified.
    I am not very much sure to create a dynamic internal based on the input from a select-option.
    Can any one please let me know how can i do this.
    I would appreciate for anyone who turns up quickly.
    Thank you,
    With regs,
    Anitha Joss.

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

Maybe you are looking for

  • ORA 600 [kkqvmRmViewFromLst1] error

    Hi, I am using Binary XML DB . Here is the DB banner info. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production "CORE 11.2.0.1.0 Production" TNS for Linux: Version 11.2.0.1.0 - Production

  • How to restore iPad to factory settings with iTunes 11

    I have updated iTunes and I need too reset my iPad. I cannot find the reset

  • How to set permissions on devicemapper block device

    I'm setting up a new RAC on RHEL5.1 using device mapper for multipath functionality. How should I set the permissions for the block devices I'm going to use for ocr, voting and asm? /dev/mapper/ocr1 /dev/mapper/voting1 etc. Regards Jon-Arne Storelv

  • Mysterious crashes

    Hi, since a few days I experience some mysterious crashes. Here is part of the system.log: Apr 8 00:00:00 Gullivers-Computer newsyslog[4889]: logfile turned over Apr 8 00:24:56 Gullivers-Computer ntpd[27]: time reset +0.239028 s Apr 8 00:37:58 Gulliv

  • Unsubscribe to itunes match(12 months)and refund .

    I want to unsubscribe to itunes match and want a refund as itunes radio is not working in india. Can you please let me know how to do it.