Create UI Items Dynamically and Call them


Last Updated:

  1. Gamesterdude

    Gamesterdude New Member This Topic's Starter

    Joined:
    Aug 5, 2010
    Messages:
    2
    Likes Received:
    0
    There are threads similar but not quite what I am looking for.
    I want to be able to create buttons dynamically during run time when the user clicks the "New" button inside the menu.
    I then need a way to dynamically name these buttons so i can call them for individual actions.
    Any code or tips would be helpful. I know in c++ i would just create an integer counter and use that to name new items using string conversion but i dont think i can do that here.
     

    Advertisement
  2. jonbonazza

    jonbonazza Well-Known Member

    Joined:
    Jul 13, 2010
    Messages:
    1,934
    Likes Received:
    458
    You do this just like you would in normal java. Create an instance of the Button class and then set its properties via the particualr methods and then add it to a layout.
     

Share This Page

Loading...