[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Java Programming Tutorial – 72 – Multiple Selection List
by
Tags:
Comments
49 responses to “Java Programming Tutorial – 72 – Multiple Selection List”
-
oh well, bucky LIED again. By the end of 1:10 this wasn't a 70 second tutorial anymore :'(
-
Who else watching it in Eclipse internal browser.
-
Good One..!!
-
great videos. thanks a lot for all your efforts 🙂
-
The getSelectedValues method used in line 26 shows deprecated currently. I would like to know the new method to use
-
OMG I'm the 666th liker :3
-
Go to an extra mile, it's never crowded…
-
/* 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( //errornew 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))}
}
-
Welcome to the last 3% of viewers since tut 1
-
The method "getSelectedValues()" is deprecated.
-
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?
-
It would be better to show the final resalt of program first. It gives a better understanding of code logic.
-
Thank you for your amazing tutorials
i have some questions , sometimes i get confused about what u write and i dont understand the conceptwhich is bad.. what is the difference between ActionListener, ItemListener and itemSelectionListenerit is reallly confusing u should mention the difference
thank you again
-
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. -
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.
-
Why does my getSelectedValues get ruled out? A line goes through it and I have no idea why…
-
You should have done gammon!
-
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
-
rightlist.setListData(leftlist.getSelectedValue());
i changed it to
rightlist.setListData(leftlist.getSelectedValuesList().toArray());
and none of them worked, how can i fix this?
-
this tutorial made me hungry so I ordered pizza
-
No joke, the first food I was thinking of putting down was also bacon.
-
300 likes for that?!? fuck logic…
-
Hi there, you may have forgotten to defined the array variable
private static String []….. ? -
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! -
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.
-
thanks a lot!!
-
it is not discrimination i said because they don't eat pork.
-
same here… just to subscribe to Bucky's videos… as at the end of every tutorial Bucky says, to subscribe his channel…. 🙂
-
Discrimination.
-
Too fast, cannot really follow…
-
please create a tutorial for connecting to database.
-
Love ya!
-
thank god your not muslim or jewish lol
-
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"}
-
I made a YT acccount just to give you 200-th like.
JK, i have a YT account for a time.
-
Export from eclipse runnable jar.
Use command prompt … as administrator
use cd to where the .jar resides
type java -jar apples.jar -
there should be a java player
-
You should send him a private message. I doubt he checks these old tutorials anymore. Also thanks for fixing my problem 🙂
-
thanks a lot
-
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.
-
export the jar
-
export the jar
-
Heart Attack Foods! Ha.
-
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.
-
Still works. So why does it matter?
-
turn on the captions. it says some funny shit.
-
Can you add regular buttons to a button group, or do you have to use JRadioButton?
-
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]);
-
@Hellrun1 Less to type, I guess since we're lazy 😉 and super has color XD
Leave a Reply