Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  HELP  (Read 945 times)
0 Members and 1 Guest are viewing this topic.
Offline corrector

JGO n00b
*

Posts: 3


Java games rock!


« on: 2004-05-20 21:34:21 »

I wrote a program, which is infact a game for my graphics class. It worked on Java 1.3, but did not on 1.4 or on the new 1.5.

Could anyone have a look at my code and let me know what might be wrong. Basically the Keystroke listener which works fine on 1.3 does not kick in or is not recogonized on 1.4 or 1.5.

You may find the code at
http://web.presby.edu/~kdwivedi/javaprogram.html

thanks!!
Offline oNyx

JGO Kernel
*****

Posts: 2943
Medals: 5


pixels! :x


« Reply #1 on: 2004-05-21 01:34:13 »

The code over there is broken.

1  
v first.add(center,BorderLayout.WEST);

1  
< if (shoot2 == true){


Roll Eyes

Well, try adding the KeyListener to one of the panels (instead of the frame) and/or try using <component>.requestFocus().

Also use a meaningfull topic and use the right board (cluebies) - this one is for showing complete games.

弾幕 ☆ @mahonnaiseblog
Offline oNyx

JGO Kernel
*****

Posts: 2943
Medals: 5


pixels! :x


« Reply #2 on: 2004-05-25 15:19:39 »

>Thanks for your reply, but I really don't understand what
>you are trying to say.

First of all - please reply in the topic. New PMs are easily overseen and others might have answered that question in the meantime.

What I ment... (#1)your code can't be compiled straight away, because there are random characters at the beginning of some lines and no one would fix all of those.

(#2) Well, just that. Try adding the KeyListener somewere else and/or try using requestFocus(). You can request the focus for any component (eg a JPanel, a Canvas, JButton etc). For example: myCanvas.requestFocus();

(#3a) The headline is just pointless. It should indicate what the topic is about (this way you'll attract more people who know what to do in that case). Eg a good headline would have been "KeyListener problems".

(#3b) We have alot of different sub forums here. If you want to get help as fast as possible you should pick the right one. In this case the Newless Clubies board, because it's a rather basic question wich doesn't has anything to do with 2d/3d/sound/networking etc.

弾幕 ☆ @mahonnaiseblog
Pages: [1]
  Print  
 
 
Jump to:  


Add your game by posting it in the showcase section.

The first screenshot will be displayed as a thumbnail.

obsidian_golem 2012-05-23 10:14:50

Danny02 2012-05-21 17:10:34

Danny02 2012-05-21 17:07:10

Danny02 2012-05-21 16:56:12

davedes 2012-05-21 13:59:23

obsidian_golem 2012-05-20 20:28:41

darkjava55 2012-05-12 16:14:40

Ultroman 2012-05-12 09:36:05

Ultroman 2012-05-11 22:49:53

Ultroman 2012-05-11 22:20:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.092 seconds with 20 queries.