hey guys i am trying to add a mouseListener to a JTextField which I have stored as an array. So I have a private JTextField tf = new JTextField[5];
for(int i = 0; i<6; i++){
tf[i]= new JTextField("Hi"); }
now I have have defo implement's all the methods needed for mouselistener and here is my mouselistener
public void mouseClicked(MouseEvent e) { if (e.getSource()==(JTextField[])tf){ System.out.println("this is a mouse click");} but this is just not working i.e. displaying text on console
try this: inside mouseMoved(), write mousepanel.setBackground(new Color(100, event.getX(), event.getY())); but make sure the height and width of the panel doesn't exceed 255 or exception will be thrown =)
Bucky how can i export this program (as .exe i think) to a PC that doesnt have Eclipse, in the case when i want to show this program to a friend who doest have software dev programs.
@amiorkovtube File>Export...>(window will pop up)Java>Runnable Jar File , then under launch configuration select the file that has your main method in it.
this gives you a .jar, im not sure how to get an .exe :(
@JKTCGMV13@amiorkovtube You cant get an .exe thats only with c/c++, a completely different langouage (with a few similaritys) I plan to learn c++ and objective-c after java :D
If you change the colors so that mouse pressed is black and then the rest are white, and then you click really fast loads of times, you have a strobe.
Wow I'm so glad I found this set of tutorials. I looked forever online and found such useless stuff on mouse listeners, and this is just what I needed.
I hava all these GUI tutorials in one file. So I have big window with bunch of buttons when I run it. For some reason I can't add status bar to it. Is that because of "SetLayout..."? Please, help
bucky, I spent about an hour studying oracle's api and after about another hour of experimentation I looked it up on youtube and this helped soooooo much!
Man, Your tutorials are way beyond simple help for all programmers. Thank You. No words to say "thank you" enough for all the efforts, not just for Java, but for the rest of tutorials on Yours channel. Great work. Would be a sin if we don't learn a bit from these ones.
hey bucky, i saw in some of your tutorials, that you have used %s, also i see now at line 26 u used %d, can you please explain what does they mean PLZ?!
Not trying to be rude. lol...but anywayz, i personal like it, The new boston doesn't really flood the sub. list. he just runs out of mins for the video. although he is a partner, i wouldn't like to watch a 45 min. long vid. lol.....but he's alright.
anyone else notice "HandlerClass" in the last video?
FewCode 1 week ago in playlist Java (Beginner) Programming Tutorials
Comment removed
NinjafyingFreak 2 weeks ago
how would you apply the changing of the background to a button instead of the whole screen?
MichaelS0305 1 month ago
I did exactly what you did and still got a shit ton of errors, I use a mac so maybe that'll help the problem
saokz7 1 month ago in playlist Java (Beginner) Programming Tutorials
Anyone else learning this so they can participate in ludum dare?
I cant wait!!!!
mcfundash1 2 months ago in playlist Java Programming Tutorials 2
@mcfundash1 Ohhohoho that is a great idea!
888chilly 2 months ago in playlist Java Programming Tutorials
hey guys i am trying to add a mouseListener to a JTextField which I have stored as an array. So I have a private JTextField tf = new JTextField[5];
for(int i = 0; i<6; i++){
tf[i]= new JTextField("Hi"); }
now I have have defo implement's all the methods needed for mouselistener and here is my mouselistener
public void mouseClicked(MouseEvent e) { if (e.getSource()==(JTextField[])tf){ System.out.println("this is a mouse click");} but this is just not working i.e. displaying text on console
truckergamer 3 months ago
tust him, there a getY method lol
ajishi99 3 months ago
you make learning fun
CodeNameJava 3 months ago in playlist Java Programming Tutorials 4
this is by far the funnest program we've made ;)
jcweaver1990 3 months ago in playlist Java Programming Tutorials
Yes :D now i can make this into mouse movement and such for my game :D WINZ :D
joeslayer97 4 months ago in playlist Java Programming Tutorials
try this: inside mouseMoved(), write mousepanel.setBackground(new Color(100, event.getX(), event.getY())); but make sure the height and width of the panel doesn't exceed 255 or exception will be thrown =)
burhan1992 4 months ago 2
@burhan1992 really cool, thanks for sharing that =)
eisa313 4 months ago
Gotta... get... coords to 0,0.... Wait what?? hes still talking? REWIND!!!
yourock129 4 months ago in playlist Java Programming Tutorials
Bucky how can i export this program (as .exe i think) to a PC that doesnt have Eclipse, in the case when i want to show this program to a friend who doest have software dev programs.
amiorkovtube 4 months ago in playlist Java Programming Tutorials
@amiorkovtube File>Export...>(window will pop up)Java>Runnable Jar File , then under launch configuration select the file that has your main method in it.
this gives you a .jar, im not sure how to get an .exe :(
JKTCGMV13 4 months ago in playlist More videos from thenewboston
@JKTCGMV13 Thanks i just found out how about a week ago and it the way you explained it, than you anyway tho.
amiorkovtube 4 months ago
@JKTCGMV13 @amiorkovtube You cant get an .exe thats only with c/c++, a completely different langouage (with a few similaritys) I plan to learn c++ and objective-c after java :D
keep programmin!
mcfundash1 2 months ago in playlist Java Programming Tutorials
@mcfundash1
c++ would be useless since u learnt Java or C#
devilazpl 1 month ago
@mcfundash1 Then how minecraft, minecraft is coded in java and to entr the game there is a .exe
kripis0 1 week ago in playlist Java (Beginner) Programming Tutorials
@kripis0 *slaps face* its called the freaking launcher that launches the jar file... Please, you're welcome to use your brain at anytime
pancakesimone 19 hours ago in playlist Java (Beginner) Programming Tutorials
7:08 EPIC VOICE CRACK!
doody884 6 months ago in playlist More videos from thenewboston 2
@doody884 hahaha heard it
aFreakinNoob 4 months ago in playlist Java Programming Tutorials
Comment removed
doody884 6 months ago in playlist More videos from thenewboston
WHO DISLIKED THIS? D:<
DazKins 6 months ago 18
@DazKins :D
ashadow0309 3 weeks ago
@DazKins trolls
glampkoo 6 days ago
If you change the colors so that mouse pressed is black and then the rest are white, and then you click really fast loads of times, you have a strobe.
michaeldcurry1 6 months ago
The mouseEntered method will never work (you wouldn't
see the "You entered the area" message, because the method
mouseMoved captures the same event.
Apart from that little "flaw", great tutorial :-)
geirendre 6 months ago
Wow I'm so glad I found this set of tutorials. I looked forever online and found such useless stuff on mouse listeners, and this is just what I needed.
destructionman1 6 months ago
is draging same as pressing - moving - releasing?
if yes, why do we need a "drag"?
Coolcl0wn 6 months ago
@Coolcl0wn
It's easier to tell the program "if dragging", instead of "if mouse moving and mouse down" every time.
JTaranus 6 months ago
Love these tutorials, amazingly done! Can't wait to watch the rest! =) !!GO BUCKY!! :D
optimizer911 6 months ago
Sorry bucky I can't subscribe two times :-(
LFSDK 7 months ago
I hava all these GUI tutorials in one file. So I have big window with bunch of buttons when I run it. For some reason I can't add status bar to it. Is that because of "SetLayout..."? Please, help
cokish1 7 months ago
ahah you should add an event that when the mous enters the window a nasty website like lemon***** pops up and then send it to a firend xD
zki2 7 months ago
I want to hack YouTube just to add a super like button.
LoganRWeber 7 months ago 11
@LoganRWeber i think it's called the favourite button
ROFLStudiosInc 4 days ago
When I try this program, I get the error "selection does not contain a main type"
MrPillyg 7 months ago
Comment removed
WinXPproff 7 months ago
Comment removed
WinXPproff 7 months ago
any client/server tutorials?
DARKOOMER 8 months ago
you shoud make like a little homework , just for practice and then make the exercise just to see if we made it right! :)
RaymundoGabriel 8 months ago
@RaymundoGabriel If he gave us homework we'd all copy and be cheaters 8D
McAwesomePossum 8 months ago
@RaymundoGabriel None of that useless homework bullshit here, please.
Ultratycoon 8 months ago
the only tutorial that helped me figured out the mouse events, great work, man, and i guess u got a lot of girls in real life huh?
daoyuanzhai 9 months ago
you are awesome sir........
arunhegdedvg 9 months ago
Bucky, you MAKE learning fun. :) Thanks so much man.
zldamstr 9 months ago
lol *high voice*Oh i didn't enter yet...*normal voice* OH i entered
lodman97 11 months ago
OH!
I just entered!
jakeywakey27 11 months ago 2
Wow, this was the most fun thing I've learned so far.
I'm having way too much fun with this. xD
You can customize it so much. o.o
Haroids 1 year ago 2
bucky, I spent about an hour studying oracle's api and after about another hour of experimentation I looked it up on youtube and this helped soooooo much!
twoofakindmagic 1 year ago
1 person learned to drag the mouse
oswaldomontenegro 1 year ago
Is there a mouseStill event?
stygiostergmail 1 year ago
@stygiostergmail: I guess you could just use: if (! mouseMoved()) //Do this in here
Yekolf 1 year ago
you're my hero
lewisp90 1 year ago
tnxxxxxxxxxxxxxx u r a gr8 help
dondesperado88 1 year ago
Thank you for great tutorials! :)
paziipa 1 year ago
I too would like some tutorials on sockets, networking and threads which is an important concept in java..
sammy3147 1 year ago
Man, Your tutorials are way beyond simple help for all programmers. Thank You. No words to say "thank you" enough for all the efforts, not just for Java, but for the rest of tutorials on Yours channel. Great work. Would be a sin if we don't learn a bit from these ones.
Greetings from Serbia
MisterNicSe 1 year ago
Coolest program thus far :D
TobiasLillestolen 1 year ago
hey bucky, i saw in some of your tutorials, that you have used %s, also i see now at line 26 u used %d, can you please explain what does they mean PLZ?!
Thanks.
fakeface20 1 year ago
@fakeface20
I have kind of just understood this, so this explanation might be wrong, but:
String.format("The item %s", item)
Means that the text is "The item " + a String object called item.
String.format("The number is %d", num)
The text becomes "The number is " + a (for example) int called num.
This was written in notepad, it probably looks better there than here on youtube comments.
Well
@thenewboston
Great tutorials! And it makes it even more great when you see what you are doing :)
Mattedatten 1 year ago
sorry but you speak too fast... anyway its interesting...
esor07ful 1 year ago
this was fun
rockyscarlet 1 year ago
Who knew how fun a program that changes from white to red could be lol...
Thanks once again for another awesome tutorial!
abovestand 1 year ago
Comment removed
haudace 1 year ago
bucky you are simply awesome
iVuTECH 1 year ago 2
This has been flagged as spam show
fuck you
Cammie010 1 year ago
@Cammie010 Because???
Gabriel0340 1 year ago
Anyone who knows how to make so that you can click on an image and then the image changes?
would appreciate if someone spended some time answering thx.
Enigma0121 1 year ago
You are awesome. Thank you so much.
cheersfornads 2 years ago 4
great tutorials, thank-you for posting them.
beanerbut 2 years ago 4
Im stuck on a program for school, how can I make the user input characters until he inputs an upper case letter w/ JOptionPane?
also
Have the user input Strings until he inputs the word "Quit". The case of the letters should not matter.
saucebiotch 2 years ago
sweet
daniel2489 2 years ago 36
HA got taired of 10 videos and you did x2 76lol
32c7c 2 years ago 4
he is up in 81 now :D:D:D:D
Great tutorials!!! (i'm on 56 or something :P)
YourAppleTechHelp 2 years ago 4
did your mama love you?
3nigma08 2 years ago
I would like some tutorials on sockets, i don't understand it very well, but i would really like to learn sockets.
MrKiller00224 2 years ago 60
@MrKiller00224 I know how to do socket programming in C quite well, but learning it in Java would be awesome!
mttisawesome 1 year ago
@MrKiller00224 I know how to do socket programming in C quite well, but learning it in Java would be awesome!
mttisawesome 1 year ago
more please
MohaSharpeyes 2 years ago 3
This has been flagged as spam show
i like your videos
uberchilly 2 years ago
Thanks, are you going to cover EJB and J2ee? Greatest tutorials!
buckyiscool 2 years ago 3
thank you!
Yazk17 2 years ago 2
Not trying to be rude. lol...but anywayz, i personal like it, The new boston doesn't really flood the sub. list. he just runs out of mins for the video. although he is a partner, i wouldn't like to watch a 45 min. long vid. lol.....but he's alright.
techgeek93 2 years ago
This comment has received too many negative votes show
u have a virus as ur name and how are u going make a virus if u dont give a sht nub
chris12x1 2 years ago
GJ again bucky, reply please, you thinking about going far into java? e.g. TCP communication, servers clients.
eliteveteran 2 years ago
This comment has received too many negative votes show
10th
TechMan8vids 2 years ago
ur clever 0.0
kingcontyz 2 years ago
76th. wow!
Algu6 2 years ago
is this action script 3?
asdFRap 2 years ago
no this is actionscript 4
Inzuki 2 years ago
no... actionscript 4 isn't out, this is java... actionscript 4 is coming in 2010. Early 2010, as stated by adobe.
Manifest222 2 years ago
I know, I was joking. I was making fun of him :P
Inzuki 2 years ago 4
thank you, i was struggling understanding mouseMotionListener
Yazk17 2 years ago
3rd comment ! lol
1deividas1 2 years ago
This has been flagged as spam show
first comment
DemiSelenaMileyx 2 years ago
Happy you got first comment? You make me laugh LOL
anotherone10 2 years ago 5