Java Programming Tutorial – 72 – Multiple Selection List

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

49 responses to “Java Programming Tutorial – 72 – Multiple Selection List”

  1. Redstone Flash Avatar

    oh well, bucky LIED again. By the end of 1:10 this wasn't a 70 second tutorial anymore :'(

  2. Eric Domanic Avatar

    Who else watching it in Eclipse internal browser.

  3. dibyendu brinto Avatar

    great videos. thanks a lot for all your efforts 🙂

  4. Francisco taveras garcia Avatar

    The getSelectedValues method used in line 26 shows deprecated currently. I would like to know the new method to use

  5. willzurmacht Avatar

    OMG I'm the 666th liker :3

  6. ahmad ameen Avatar

    Go to an extra mile, it's never crowded…

  7. Anil kumar Avatar

    /* not able to run this program getting error , anyone help */

    import java.awt.*;
    import java.awt.Event;
    import javax.swing.*;
    import javax.swing.event.*;

    public class Gui6 extends JFrame {

    private JList leftlist ;
    private JList rightlist;
    private JButton movebutton;
    private static String[] foods = {"bacon","wings","apple","banana","proteinshake"};

    public Gui6(){

    super("Title");
    setLayout(new FlowLayout());

    leftlist = new JList(foods);
    leftlist.setVisibleRowCount(3);
    leftlist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    add(new JScrollPane(leftlist));

    movebutton = new JButton("SELECTED ITEMS");
    movebutton.addActionListener( //error

    new ActionListener(){ //error

    public void actionPerformed(ActionEvent event){ //error

    rightlist.setListData(leftlist.getSelectedValues());//error

    }
    }
    );

    add(movebutton);

    rightlist = new JList();
    rightlist.setVisibleRowCount(3);
    rightlist.setFixedCellWidth(100);
    rightlist.setFixedCellHeight(15);
    rightlist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    add(new JScrollPane(rightlist))

    }

    }

  8. Brock Jaeger Avatar

    Welcome to the last 3% of viewers since tut 1

  9. Kepler Avatar

    The method "getSelectedValues()" is deprecated.

  10. Jordan Shackelford Avatar

    Changed my code to:
    rightlist.setListData(leftlist.getSelectedValuesList().toArray());

    since getSelectedValues() is deprecated. I get a yellow squiggly line under that, and when I mouse over I get a warning that says "Type safety: The method setListData(Object[]) belongs to the raw type JList. References to generic type JList<E> should be parameterized".

    My program will run, but only the leftlist and the move button show up on the screen. When I click the move button I get a bunch of errors.

    So how do I fix these errors and get rightlist to show up on the screen?

  11. sosorrymen Avatar

    It would be better to show the final resalt of program first. It gives a better understanding of code logic.

  12. mostafa sharaf Avatar

    Thank you for your amazing tutorials
    i have some questions , sometimes i get confused about what u write and i dont understand the concept which is bad .. what is the difference between ActionListener, ItemListener and itemSelectionListener

    it is reallly confusing u should mention the difference

    thank you again

  13. Youssef Rabbah Avatar

    I wished if this lesson was on girl's bod! because I knew many name, but food not much. anyway the ListSelectionListener() in which case we have to use the method?
    can I use it if drag object  and copy &paste.

  14. Mikule Walters Avatar

    Go back to the previous videos then all the stuff he's doing is repetitive and already been done he's just chaining some variable names around here and there.

  15. Epicnerd73 Avatar

    Why does my getSelectedValues get ruled out? A line goes through it and I have no idea why…

  16. Epicnerd73 Avatar

    You should have done gammon!

  17. עופר קרן Avatar

    hi, how do u know all those commands??? like u said there are the java regular things we have to write but than u are using commands that i never understand how to find them all.   do someone have any book or source of information that i can probably use?   thanks

  18. Cesar Martinez Avatar

    rightlist.setListData(leftlist.getSelectedValue());

    i changed it to

    rightlist.setListData(leftlist.getSelectedValuesList().toArray());

    and none of them worked, how can i fix this?

  19. Jeff Smith Avatar

    this tutorial made me hungry so I ordered pizza

  20. TheNegronomicon Avatar

    No joke, the first food I was thinking of putting down was also bacon.

  21. Key Word, Cacti Avatar

    300 likes for that?!? fuck logic…

  22. 1nukarm Avatar

    Hi there, you may have forgotten to defined the array variable
    private static String []….. ?

  23. Gedrick Zano Avatar

    I'm having an error when i started to type
    leftlist= new JList(foods);
    it says"the constructor JList(String []) is undefined.
    can someone help me to fix this? Thanks in advance!

  24. Kenny Avatar

    He goes fast because these videos were made when YT still had a ten minute time limit on videos. But he also goes fast because ActionListeners are something that's already been covered several times in previous videos, and because the other stuff is rather basic and easy to follow.

  25. Aziz Sobirov Avatar

    it is not discrimination i said because they don't eat pork.

  26. Aooz Zooa Avatar

    same here… just to subscribe to Bucky's videos… as at the end of every tutorial Bucky says, to subscribe his channel…. 🙂

  27. warabutihum Avatar

    Too fast, cannot really follow…

  28. deepak patil Avatar

    please create a tutorial for connecting to database.

  29. Aziz Sobirov Avatar

    thank god your not muslim or jewish lol

  30. Victor Popescu Avatar

    LOL I am hungry as shit and when bucky started to call some variables I was like: {"food","great food","I want that food", "give me that!!","a little more can't hurt"}

  31. Marko Perica Avatar

    I made a YT acccount just to give you 200-th like.

    JK, i have a YT account for a time.

  32. Kevin Pek Avatar

    Export from eclipse runnable jar.
    Use command prompt … as administrator
    use cd to where the .jar resides
    type java -jar apples.jar

  33. Kevin Pek Avatar

    there should be a java player

  34. The Man From The Internet Avatar

    You should send him a private message. I doubt he checks these old tutorials anymore. Also thanks for fixing my problem 🙂

  35. Mat O Avatar

    I tried doing this and when I go to run it it asks me if the application installed correctly and when I tried again it did nothing o.O.

  36. TheaDragonSpirit Avatar

    Heart Attack Foods! Ha.

  37. inuasha880 Avatar

    Eventually it will no longer work at all. They will kinda fade it into the background then kill it. It is just better for the future to know that it will not be there and how to handle that change.

  38. Scott Anon Avatar

    Still works. So why does it matter?

  39. the youtuber Avatar

    turn on the captions. it says some funny shit.

  40. dfsfklsj Avatar

    Can you add regular buttons to a button group, or do you have to use JRadioButton?

  41. Lei Sheng Avatar

    If you want to make a button to clear the list, create another JButton called clrButton or something with the ActionListener and inside the actionPerformed method, write:

    rightlist.setListData(new Object[0]);

  42. Mark Christoper Vizcarra Avatar

    @Hellrun1 Less to type, I guess since we're lazy 😉 and super has color XD

Leave a Reply

Your email address will not be published. Required fields are marked *