Computer Science Canada Turing in java (applet) |
Author: | r.m_spy [ Sat May 01, 2010 8:43 am ] | ||
Post subject: | Turing in java (applet) | ||
this post is for those who know both turing and java GO North toronto collegate institude!
please help me with the following 1) when you use the robot mouse, it doesn't return to the program 2) I dont know how to get keyboard 3) any suggestions/complements/complaints Im all ears |
Author: | TerranceN [ Sat May 01, 2010 10:02 am ] |
Post subject: | RE:Turing in java (applet) |
I have no idea why you want to re-create Turing, but w/e... 1. Is it intended that the Robot mouse click in screen co-ordinates, or did you mean window co-ordinates? Anyway, the robot clicks don't seem to work outside of the applet (it's as if it clicked the top left icon of the other window, even if thats not where the mouse is, and I'm assuming you're using Windows). I don't know what's wrong, I have never used 'Robot' before. 2. Use a 'KeyListener' to get 'KeyEvent's like how you used 'MouseListener' to get 'MouseEvent's (the methods are a little different, just look it up). You can easily store what keys are down in an array of booleans so you can use it kind of like an 'array char of boolean' (IIRC) in Turing. 3. Why do you want to re-create Turing? I'm sure most people here agree that Java's standard libraries are better than Turing's. What's the point of re-creating every draw call? Is it that hard to learn to use (and see the advantages of) Graphics objects? The whole point is so that everything that uses graphics does not have to make its own drawing methods. Also, Indent your code (maybe it got butchered when you posted it?). Finally, it would be nice if you told us what you are trying to do with this (ie. is to to help people that use Turing learn Java?). Sorry for being so harsh, and maybe I'm missing something here, but IMO if you want to use Turing, just use Turing, no point in trying to re-create it elsewhere. Hope that helps. |
Author: | r.m_spy [ Sat May 01, 2010 12:31 pm ] |
Post subject: | RE:Turing in java (applet) |
as for 1) I do have windows, and it loops instead of going back to the program for 2) Thank you so much!!!! this is why I post my java programs online and 3) I am trying to recreate turing so I can put it in html, instead of exe. plus, I can teach my friend graphics in java by him seeing where everything goes visually. PS: I wouldnt of asked for complaints if i didnt want any thank you r.m_spy |
Author: | r.m_spy [ Sun May 02, 2010 8:43 am ] | ||
Post subject: | Re: Turing in java (applet) | ||
Okay, Ive created this, but Im unable to intrgrate it in my turing applet. Help!!!
|
Author: | TerranceN [ Sun May 02, 2010 3:55 pm ] | ||
Post subject: | RE:Turing in java (applet) | ||
You need to add the KeyListener like you did the other listeners.
|
Author: | kingghaffari [ Sun Oct 23, 2011 7:18 pm ] |
Post subject: | RE:Turing in java (applet) |
I go to North Toronto too! Are you in grade 12? I am in grade 11 ![]() |