Computer Science Canada Mouse Listener |
Author: | xHoly-Divinity [ Fri Apr 06, 2007 6:07 pm ] |
Post subject: | Mouse Listener |
Can I use mouseListener in an applet (runnable), or do i have to use a JFrame/JApplet? |
Author: | ericfourfour [ Fri Apr 06, 2007 11:50 pm ] |
Post subject: | RE:Mouse Listener |
Mouse listeners work with all components I believe. |
Author: | xHoly-Divinity [ Sat Apr 07, 2007 11:35 am ] |
Post subject: | Re: Mouse Listener |
Hmm.... is it possible to use a mouseListener in parallel with a runnable? Cuz i need both keyboard and mouse input? |
Author: | Ultrahex [ Sat Apr 07, 2007 1:22 pm ] | ||
Post subject: | Re: Mouse Listener | ||
xHoly-Divinity, hey school chump, yes you can use any component and use a mouselistener, keylistener, mousemotionlistener etc.... and yes you can run them in parallel using two threads, however you do not need this for the program you are doing. just implement both into the same component / add them to the same component, and you will be fine, both will run at same time. If you don't trust me.....
|
Author: | wtd [ Sat Apr 07, 2007 1:38 pm ] |
Post subject: | RE:Mouse Listener |
Learn about interfaces, and learn to read the java.sun.com API docs and you won't need to ask this question. ![]() |
Author: | xHoly-Divinity [ Tue Apr 10, 2007 5:09 pm ] |
Post subject: | Re: Mouse Listener |
Thanks ultrahex ![]() Do u think I can do the whole thing in applet and not use JFrames? |
Author: | ericfourfour [ Tue Apr 10, 2007 9:10 pm ] |
Post subject: | RE:Mouse Listener |
You are not required to use swing when working with applets. |
Author: | wtd [ Wed Apr 11, 2007 12:03 am ] |
Post subject: | RE:Mouse Listener |
When Swing is available, why use vanilla AWT? |
Author: | xHoly-Divinity [ Wed Apr 11, 2007 5:35 pm ] |
Post subject: | Re: RE:Mouse Listener |
wtd @ Wed Apr 11, 2007 1:03 am wrote: When Swing is available, why use vanilla AWT?
considering it... maybe towards the end of the project I can 'convert' it to swing bcuz right now I want to get the functionality and everything working and so if there's time in the end (since i've very little experience with swing =/) |
Author: | xHoly-Divinity [ Wed Apr 11, 2007 6:07 pm ] |
Post subject: | Re: Mouse Listener |
Is it possible to get actionListener and keyListener working together? I tried but when I add the actionListner, the keyListener doesn't work ![]() |
Author: | HellblazerX [ Thu Apr 12, 2007 1:00 pm ] |
Post subject: | RE:Mouse Listener |
The two should work together. When you say that the keyListener doesn't work, what do you mean by it? |
Author: | xHoly-Divinity [ Thu Apr 12, 2007 9:04 pm ] |
Post subject: | Re: Mouse Listener |
ahhhh figured it out... when u make the button e.g. add (myButton), u have to add it to the ActionListener AND the KeyListener. I forgot to add to KeyListener so that's why it didn't work ![]() |
Author: | HellblazerX [ Fri Apr 13, 2007 7:23 am ] |
Post subject: | Re: Mouse Listener |
Lol! Now it seems that my keyListener isn't working. I implemented the interface, set up my methods, and added the keyListener. Did I forget anything, cuz I don't think I did. |