Quick question, I thought static doesn't denote something that can't change. So instead of private static [] fileName, could you use public static final [] fileName ? (Can anybody explain his reasoning?, since I thought final was used to denote that it can't change).
Please tell me what the hell is wrong with this private Icon[] pics = {new ImageIcon(getClass().getResource(filename[0])), new ImageIcon(getClass().getResource(filename[1]))};
Hey, Bucky how do you make a variable change after you pick a option in the Combo Box? 'Cause I don't know how to that exactly. Thanks if you could answer me.
Theres kinda a problem, when he said "lets make it static so it cant change" he was wrong, static is just something to make the variable accessable by other classes as a constant (i think) but to make it not changeable you need to use final :P
@mouzsport Static can change, it's just shared by all members (or instances) of a class. It's FINAL that doesn't change (but you posted this 9 months ago so you probably know now any way) :)
I'm getting an error. I'm running on a Mac, and the pictures weren't showing up on the left sidebar src thing, so I copied them to there, but now it's saying:
Multiple markers at this line
" - Cannot make a static reference to the non-static method getClass() from the type Object - b cannot be resolved to a variable"
for the error. I think it's not able to get the resource because copying it is only a copy. Any ideas?
@Mewigi You dummy head. Stop trying to be smart. I had the Icon[] array set as static. Maybe I should actually listen to when the pop up thingy says "static" and "non-static".
You can now access them individually if you wish or loop through them to set a value. This is usually good if you use the same value over and over, for default values, or if you have a formula like image1 image2. for(int i=0;i<fileName.length;i++) { fileName[i] = ""; }
It was really hard to see the end of your private icon [] pic = line. The first time the pictures would not change when I ran it, so I went back and heard you than say to add the second array you need 1 so change it to 1. It than worked! You are AWESOME. PLEASE SHOW HOW TO MAKE JUST ONE CLASS FILE WITH THE MAIN CLASS INSIDE THE APP PLEASE!!
Can someone please help me out? i want to create three jcomboboxes. where the content of the 3rd box depends on the selection of the 2nd and that one depends on the selection of the first.EX:1st box holds list of manufactures while the second holds list of models and the 3rd holds trims. if i select honda in the 1st then it displays accord, civic, pilot in the second box and if i select accord then it would display LX Sedan, EX Sedan...etc. I would really appreciate anyones help. Thanks.
@sighkhol if that's the case you might want to use an if else statement so where if the 1st drop-down = toyota then the second drop down box holds models
its better do GUI on Visual Basic, then after make ur program on java and when the VB GUI is on, ur program starts to run.
Guy: Why use VB?
Couse he have a more easy interface, so, its better for "noobs" in Java.
Guy: But isnt that why bucky is here?
Yup but thats just a suggestion ;D
jeanmon357 3 weeks ago
@jeanmon357 But in visual basic you program in BASIC, not java, so how does that help??
gofish8195 2 days ago in playlist Java (Beginner) Programming Tutorials
Quick question, I thought static doesn't denote something that can't change. So instead of private static [] fileName, could you use public static final [] fileName ? (Can anybody explain his reasoning?, since I thought final was used to denote that it can't change).
ranger296 2 months ago in playlist Java Programming Tutorials
This has been flagged as spam show
Please tell me what the hell is wrong with this private Icon[] pics = {new ImageIcon(getClass().getResource(filename[0])), new ImageIcon(getClass().getResource(filename[1]))};
Alavistaven2012 2 months ago
Comment removed
Alavistaven2012 2 months ago
This has been flagged as spam show
What the fuck is wrong with this.
private Icon[] pics = {new ImageIcon(getClass().getResource(filename[0])), new ImageIcon(getClass().getResource(filename[1]));
Alavistaven2012 2 months ago
private Icon[] pics = {new ImageIcon(getClass().getResource(filename[0])), new ImageIcon(getClass().getResource(filename[1]))};
oakland5353 3 months ago in playlist Bucky's Java Tutorial
i cant see what uve written, i cant get it to work, ive tried the braces but itsays its wrong
britishgoose01 4 months ago
@britishgoose01 You can''t see what hes written? Are you blind or something :L
MinecraftCreators 3 months ago in playlist Java Programming Tutorials
@britishgoose01 Have you fixed it yet, I still am not able to fix it it's fucking annoying.
Alavistaven2012 2 months ago
your perfect ;)
peymanforceman 6 months ago
Hey, Bucky how do you make a variable change after you pick a option in the Combo Box? 'Cause I don't know how to that exactly. Thanks if you could answer me.
FlockGaming 7 months ago
lol the way you pronounce picture is really funny
oliball123 8 months ago
@oliball123 He says it like pitchers! ;) Very funny!
baxterb94 7 months ago
Theres kinda a problem, when he said "lets make it static so it cant change" he was wrong, static is just something to make the variable accessable by other classes as a constant (i think) but to make it not changeable you need to use final :P
MrBlockersPro 10 months ago
@MrBlockersPro Static does mean it doesn't change dude. when your talking about 'accessibility' thats the public or private code parts.
mouzsport 10 months ago
@mouzsport Static can change, it's just shared by all members (or instances) of a class. It's FINAL that doesn't change (but you posted this 9 months ago so you probably know now any way) :)
TheViolinCalamity 2 weeks ago
I didnt really understand why we made it static
DawnOfDemise 10 months ago
@DawnOfDemise why not? we werent going to change the values of it anyway
jynxgizmo 10 months ago
This is so cool.
NeoThePaladinOfLight 10 months ago
I'm getting an error. I'm running on a Mac, and the pictures weren't showing up on the left sidebar src thing, so I copied them to there, but now it's saying:
Multiple markers at this line
" - Cannot make a static reference to the non-static method getClass() from the type Object - b cannot be resolved to a variable"
for the error. I think it's not able to get the resource because copying it is only a copy. Any ideas?
Mewigi 11 months ago
@Mewigi You dummy head. Stop trying to be smart. I had the Icon[] array set as static. Maybe I should actually listen to when the pop up thingy says "static" and "non-static".
Mewigi 11 months ago
@Mewigi Try putting the pictures in the bin folder with the classes
McAwesomePossum 8 months ago
@Mewigi put pics in bin
Alavistaven2012 2 months ago
@Alavistaven2012 You're 9 months late, but thanks anyways..
Mewigi 2 months ago
I notice that each java tutorial have less views, the weaks can't hold on.
digaum8754 1 year ago
Isnt there easier way to hold on all off the images in the array, f.e. if u have 20 of them?
Ernestas23 1 year ago
@Ernestas23, you can define your array as such:
private static String fileName;
Then in the method use:
fileName = new String[20];
You can now access them individually if you wish or loop through them to set a value. This is usually good if you use the same value over and over, for default values, or if you have a formula like image1 image2. for(int i=0;i<fileName.length;i++) { fileName[i] = ""; }
HGeneAnthony 1 year ago
Not just thank you, but something more than that...............
ishafeeqi 1 year ago 2
It was really hard to see the end of your private icon [] pic = line. The first time the pictures would not change when I ran it, so I went back and heard you than say to add the second array you need 1 so change it to 1. It than worked! You are AWESOME. PLEASE SHOW HOW TO MAKE JUST ONE CLASS FILE WITH THE MAIN CLASS INSIDE THE APP PLEASE!!
djlovedreamer 1 year ago
@djlovedreamer same problem i had...:D
osafiiracit 1 year ago
Can someone please help me out? i want to create three jcomboboxes. where the content of the 3rd box depends on the selection of the 2nd and that one depends on the selection of the first.EX:1st box holds list of manufactures while the second holds list of models and the 3rd holds trims. if i select honda in the 1st then it displays accord, civic, pilot in the second box and if i select accord then it would display LX Sedan, EX Sedan...etc. I would really appreciate anyones help. Thanks.
sighkhol 2 years ago
@sighkhol if that's the case you might want to use an if else statement so where if the 1st drop-down = toyota then the second drop down box holds models
Casketreaper 1 year ago
Hi, You tutorials are great.
????
Does the JCombox event receive the events as an array?
o0ohawkeye 2 years ago
Thank you alot
Waranle 2 years ago 30
Great timing. I have to do a GUI pretty soon. thanks for these vids.
NewKokujinOptions 2 years ago 23
This comment has received too many negative votes show
wewt! 5th comment!!!!
Epic video >:)
gold1055555 2 years ago
This comment has received too many negative votes show
2nd comment! awesome vids as well!
VNWTV 2 years ago
This comment has received too many negative votes show
first
jricketts1 2 years ago
This has been flagged as spam show
ffff
fannypenis 2 years ago