list.addListSelectionListener(... is throwing an error.
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: javax.swing.JList.addListSelectionListener at JavaTutorial.Gui.init(Gui.java:29) at JavaTutorial.Tutorial.main(Tutorial.java:18)
Have checked the code and the imports and all looks good. Help?
I used colorNames.length instead of counting the number of items I put in the parameters. Cause if you have like 12345 different items it would be a pain to count them out!
The problem with that is that your screen wouldn't fit all of the items in. If you had 10000 items in the list then you would still only set the visible row count to a number like 20 so that people could only see that many at a time but have the choice to scroll down further.
Wow. It is very hard to find a very good Java tutorial online without download for free online. I really thank you for this because this is very helpful and a great source to learn Java from.
i hope this year I become a java programmer I can see a very good explaining I just need time to study your tutorials thanks ...so much actually this is not me I mean the user name , my user name is lmozabeth
woah, go fullscreen with the java program you just made, hold down the mouse, and scroll up and down over the colors, it freaks out your eyes, try it!
@athimaddy apparently in JList there is a method getSelectedIndex() which returns the position number of what is selected (counting from the top of the list -> 0,1,2,3...) so Bucky used that number(read: method) to automatically chose a color from "colors" array
Nice tutorial, however it could be a bit more precise. For example the 1 through 4, if it's an array it starts at 0... still good job and much needed.
I had problems seeing the end of get....Index line and had to figure out how it looks. But more importantly if the values in both arrays were congruent. If you click a color and the colors didn't match it would display the wrong color.
Dear bucky ..i never really understand java till i saw your vid's man..i was majoring in CS back in 1999 and i dropped out (u know 3rd world universities) but after 10 years u resurrected the the love of programming in me .
u were able to make me understand what professors couldn't possibly get in my head .
RESPECT
N.B: can you tell where u were educated ?
coz i'm planning to study in the US ; and your advise on this issue is highly appreciated ...keep up the good work :P
@kh503335 I studied Chemical Engineering in a 3rd World Country Uni, and my professors made me hate the degree i was working for and i never developed any respect for them!
In my final year, I wanted to know how programs worked - so i came looking for Java tutorials. I found thenewboston - he got my respect within a week. Three months later, i wish i had gone into computer science with Bucky as my professor!
Never mind earlier post. Forgot to import javax.swing.event.*.
tackorduck 1 day ago in playlist Java (Beginner) Programming Tutorials
list.addListSelectionListener(... is throwing an error.
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: javax.swing.JList.addListSelectionListener at JavaTutorial.Gui.init(Gui.java:29) at JavaTutorial.Tutorial.main(Tutorial.java:18)
Have checked the code and the imports and all looks good. Help?
tackorduck 1 day ago
getContentPane().setBackground(colors[list.getSelectedIndex()]);
this is the line which u " cant see" put this in ;)
princekhurana14 1 month ago 5
@princekhurana14 thanks Greg :D
TheMathMystic 1 week ago
great tutorials for beginners..
Javanak 1 month ago
You could to learn list (Nodos, punteros)... respond me please!!!!
Torfay 2 months ago
woo 38 thousand :D Our graduating class is diminishing!
Alavistaven2012 2 months ago
list.setVisibleRowCount(colornames.length);
he he got here little smarter thx to you bucky ;D <3
TheSapphir3 2 months ago
RED WHITE AND BLUE...AND BLACK
CodeSensitive 2 months ago 3
If you think purple is cool, add "magenta" to the two lists ;-)
Jesteria78 5 months ago
list.setVisibleRowCount(colorNames.length);
I used colorNames.length instead of counting the number of items I put in the parameters. Cause if you have like 12345 different items it would be a pain to count them out!
fbakersj 5 months ago 2
@fbakersj
The problem with that is that your screen wouldn't fit all of the items in. If you had 10000 items in the list then you would still only set the visible row count to a number like 20 so that people could only see that many at a time but have the choice to scroll down further.
wo1fst8 5 months ago in playlist Java Programming Tutorials
@fbakersj nice alternative haha i didnt think of that, thanks! :D
gr1mtoy6100 4 months ago
careful not to hold left mouse and move around the list cuz u can get seizures
seopeter22 6 months ago
After the beginner tutorials im goin to game devolopment thx bucky!
dtgonzalez1 6 months ago
This has been flagged as spam show
This is actually the first program in your series that I couldn't get to work.
The list listener inside, on line 22, is where things start getting confusing.
holypupppet 7 months ago
Comment removed
holypupppet 7 months ago
Best Program you have taught us! Soo COOL!
Kalvin104 7 months ago
Who knows what does it do?
new JScrollPane(list);
elmira1986elmira 7 months ago
@elmira1986elmira
I think it makes the list Scrollable (try it out by setting setVisibleRowCount(2) - you'll get a scroll bar)
I'm just wondering why I can't put there JList
rychu130 7 months ago
Wow. It is very hard to find a very good Java tutorial online without download for free online. I really thank you for this because this is very helpful and a great source to learn Java from.
soulelemanator97 7 months ago 4
WHY YOUTUBE WHY DO YOU KEEP F*CKING YOUR WEBSITE UP
kirbyphanphan 7 months ago
bucky, the world is getting smart!!
solde99 7 months ago
the thing i didnt understand is how you did
list.addListSelectionListener(new ListSelectionListener(){method{getContent....}});
you made a method inside the list.addListSelectionListener(new method)..... how does that work?
xxmannylee1992xx 9 months ago
@xxmannylee1992xx He made an anonymous class.
kymykaly 8 months ago
@xxmannylee1992xx He explained it a few vids back Check them out hope this helps
Bananapoopman 8 months ago
Lol "In People language..."
zldamstr 9 months ago
i hope this year I become a java programmer I can see a very good explaining I just need time to study your tutorials thanks ...so much actually this is not me I mean the user name , my user name is lmozabeth
eduardo007 10 months ago
i hope this year I become a java programmer I can see a very good explaining I just need time to study your tutorials thanks ...so much
eduardo007 10 months ago
Amazing tutorials! I sometimes wish they would be a little more than 9 minutes.
Thanks for sharing!
jdoyon007 10 months ago
เดี๋ยวผมได้เรียนแน่นอนครับ ปี1
nikjaza 1 year ago
@nikjaza yes
mihek 1 year ago
woah, go fullscreen with the java program you just made, hold down the mouse, and scroll up and down over the colors, it freaks out your eyes, try it!
Yekolf 1 year ago
the line num from 21 -24, i can't understood , plz anyone help me!
athimaddy 1 year ago
@athimaddy apparently in JList there is a method getSelectedIndex() which returns the position number of what is selected (counting from the top of the list -> 0,1,2,3...) so Bucky used that number(read: method) to automatically chose a color from "colors" array
mufaPufaDha 1 year ago
hi mate.. one good thing bout ur tutorials apart from many is u make things look easy..
sammy3147 1 year ago
fantastic!
azadl8349 1 year ago
realy thanks very much
khaledMohammedRagheb 1 year ago
hi Bucky, how many compilers are installed in your BRAIN LOL>
peace your one of the best :P!
fakeface20 1 year ago 4
Awesome man...
uksanjay 1 year ago
Change this in line.no17! list.setVisibleRowCount(1); this is cool!
ArivazhaganRocks 1 year ago
Nice tutorial, however it could be a bit more precise. For example the 1 through 4, if it's an array it starts at 0... still good job and much needed.
bluescanfly1981 1 year ago
very cool...and understandable..subscribed
legu333 1 year ago
I think you're going to put MIT out of business.
: ]
Fbiman93 1 year ago 3
I had problems seeing the end of get....Index line and had to figure out how it looks. But more importantly if the values in both arrays were congruent. If you click a color and the colors didn't match it would display the wrong color.
ytgodzilla 2 years ago
good
0rang3Flash 2 years ago
Dear bucky ..i never really understand java till i saw your vid's man..i was majoring in CS back in 1999 and i dropped out (u know 3rd world universities) but after 10 years u resurrected the the love of programming in me .
u were able to make me understand what professors couldn't possibly get in my head .
RESPECT
N.B: can you tell where u were educated ?
coz i'm planning to study in the US ; and your advise on this issue is highly appreciated ...keep up the good work :P
kh503335 2 years ago 107
Awesome!
ytgodzilla 2 years ago 31
@kh503335 I studied Chemical Engineering in a 3rd World Country Uni, and my professors made me hate the degree i was working for and i never developed any respect for them!
In my final year, I wanted to know how programs worked - so i came looking for Java tutorials. I found thenewboston - he got my respect within a week. Three months later, i wish i had gone into computer science with Bucky as my professor!
Bucky, you da man!
ErichLancaster 1 year ago
@kh503335 did he response?
Genuigr 2 months ago in playlist Java Programming Tutorials
@kh503335 he dropped out of university, he's a self taught man.
Claymore2408 2 months ago in playlist Java Programming Tutorials
This has been flagged as spam show
noooooo, 3rd
Phobiaaphobic 2 years ago
Great vid keep 'em coming.
rand0m4productions 2 years ago
Wow finally after 71 tutorials done ! Man you put alot of effort onto your videos awesome job !
salsabil18 2 years ago