JavaFX and Scene Builder Beginner Course - IntelliJ #7: Add and remove items from ListView

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 18

  • @joshabreu1750
    @joshabreu1750 Рік тому

    You saved me! Thank you bro!

  • @marcinstrzesak346
    @marcinstrzesak346 Рік тому

    thank you so much. Good video

  • @lucasmuscolo6026
    @lucasmuscolo6026 3 роки тому +1

    HI there... could you do the same with tableview??? Thanks a lot for all your videos.... :D

  • @shopochhandla645
    @shopochhandla645 2 роки тому

    if i want to select a text in my listview to move it to another listview in the same scene, which "on mouse clicked" action should i use ?

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      I would just use the "on mouse clicked" then get the information that is clicked and then remove it from the current list, add it to another list and update both listview, one with the removed information and the other with the information added.
      Not sure I understand your question let me know if I got it wrong.

  • @tttttroll
    @tttttroll 2 роки тому

    Now how can you use a listView when passing data from a different scene

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      We would need some kind of separate object we can use to pass the information between the scenes, the simplest way is to use a singleton as a link where we can send and retrieve our data.

    • @tttttroll
      @tttttroll 2 роки тому

      @@Randomcode_0 thanks for the feedback only one that gave me a path to think off now

  • @jasmin10314
    @jasmin10314 3 роки тому +1

    Hey, does anyone have an idea how to add a view list to another view list? Thanks in advance

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I am not quite sure I understand what you want to build. Could you give an example of the functionality for this setup, then I will try my best to find a solution.

    • @jasmin10314
      @jasmin10314 3 роки тому +1

      @@Randomcode_0
      Thank you for replying to my question. We have to implement a game for a project. In a setting window the user can add the names of the players. Then the user can press a button to start the game. There is now a game window where the players names will be displayed with the current score. In both windows the names of players should be saved in a list view and I'd like to add the items of the first list view in the setting window to the list view in the game window. I hope this is more precisely and it helps. :)

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I think I understand the problem, you need a way to send send information between scenes.
      The first solutions I could think of is to use a singleton, which is a static object that can only have one instance. You then parse information to the singleton and then get this information in the game.
      Another solution would be to save the game settings in a file(like JSON) and the read the file when the game is started.
      Let me know if my suggestions were helpful!

  • @nishatvasker7397
    @nishatvasker7397 3 роки тому +1

    source code plz!

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      Source code! Here you go:
      gist.github.com/Da9el00/db148c8527f7a9725f78bef642e1c394