Java Swing/GUI Tutorial- Mouse Action Listeners - Creating MouseListeners

preview_player
Показать описание
This tutorial will show you how to create MouseListeners. These can be used to detect when the mouse has been pressed down, clicked, released and others.

You can use MouseListeners to create many programs, for example, a program where the user draws his own shape on a canvas (like PCPaint). Hope you enjoy
Рекомендации по теме
Комментарии
Автор

I like how you breathe directly into the microphone. It gives definition to your voice.

XAttaHabibX
Автор

These are some of the best Java Tutorials on the Planet.
Nevertheless, I agree with those who suggest that you get a better voice mic.
For example, find a block of foam. Packing foam for example. Dig out a cavity in the block and stick you mic into the foam block. This should reduce the distortion and remove all explosive breathing into the mic.
I emphasize that your tutorials are very good indeed. Good Luck to You.

basalduat
Автор

Thanks for the help. For future reference, you should put the code you type into a PasteBin and then link it just so it's easier to see the code as a whole. Just a suggestion, thanks a bunch!!

bylandab
Автор

nice tutorial :3
[ASK]
after I remove line 14, super.paintComponent(g); as ur advice
when I run th e java code, there is a little red dot on the top left panel. could u help me to clear up that? thx

inakokasih
Автор

Hello Sir, I need help. I want to customize mouse controls, I want to give graphics effect like change mouse cursor and it should draw some fancy circles around any mouse click. But drawing should be directly on screen not on jpanel exactly like in this video your mouse click shows classic effects on every click, anywhere on screen

sagarchavan
Автор

very helpful tutorial, but what if i want to draw rectangles instead of circles. if i have 2 buttons, one for circles and one for rect, when i press circles i can click on the screen and circles will be drawn, if i click on rectangels then they will be drawn instad..help?:)

fornavnetternavn
Автор

thank a lot, your tuto is  very good, stay on the good parth

Mauricode-Academy
Автор

Is there any way to not to display the initial oval?

bharatgupta
Автор

@MrJavaHelp wer can i get this tutoriaL?...
u have tutoriaLs in net beans?.

bloodymscre
Автор

Problem I found: Sometimes when you "Click" and you have moved the mouse during the "Click" the dot will not appear. Simply changing mouseClicked(MouseEvent e) to mouseReleased(MouseEvent e) fixed this...in case anyone else had this problem..

CannonMan
Автор

You should number your video's man.. :)

janverm
Автор

my ears died in the first 2 seconds of the video, had to turn down volume to half of what normal is. :/

applesthepi
Автор

ok now... the tutorial is useful and thank you for that, but next time you could put your microphone even deeper in your mouth. man that's just annoying how you breathe into mic I barely made myself listen the video to the end :(

Sagittarius
Автор

I think you should get that mic out of your mouth.

mwglItChkINg