7 Topics

Member Avatar for
Member Avatar for caswimmer2011

Hi, I've used keylisteners multiple times, but I am having trouble with this situation. I want the keylistener to recognize a series of characters. For example, if 'e' is typed, I want the program to listen for 'l', then 'e', etc. (spelling "elephant", if you wanted to know). It recognizes …

Member Avatar for JamesCherrill
0
224
Member Avatar for 2concussions

hello, hello! im probably being really dumb again, but i can't get java to run keyPressed() when i press a key. do i need to initialize the keylistener somewhere? any input is appreciated!(even if it's not help) import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JPanel; import …

Member Avatar for NormR1
0
304
Member Avatar for thes0mething

Hello everyone on daniweb!:) I'm trying to make a programme which will move a picture to the sides when pressing the right or left arrowkeys. I did successfully put a picture in and I was able to change the side coordinates(called "side" in the programme) to make the picture move. …

Member Avatar for Ezzaral
0
1K
Member Avatar for caswimmer2011

Hey. I am trying to make a "virus" that will not let the user exit the program even with pressing Command+Q (oh, ya, I have an Apple). Here is what I have so far: if (keylistener.getKeyCode()==81){ System.out.println("Works"); } I have the println just to see if it works (which it …

Member Avatar for peter_budo
0
141
Member Avatar for Skretch

Trying to add a key keylistener to a program i am making but it wont work. cant find the reason :/ any help would be awesome:) Display.class [CODE]package com.mono.main; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JFrame; import javax.swing.JPanel; import com.mono.main.handler.Controller; import com.mono.main.handler.Game; import com.mono.main.handler.InputHandler; public class Display extends JPanel implements Runnable …

Member Avatar for Skretch
0
345
Member Avatar for mangopearapples

I'm trying to make it so when I press ESC, it RestoreScreen() but it doesn't work. Now I don't know whether it's my method RestoreScreen() or my listeners. This is my code: [code]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class main extends JFrame implements MouseListener,KeyListener{ public void keyPressed(KeyEvent e) { …

Member Avatar for roxin_phoenix
0
183
Member Avatar for mangopearapples

Why won't this work? I'm trying to make a ball appear and move along my screen but it's failing :'( . I'm :( and also trying to make it so when you press any key it restores the full screen but that's also failing. :'( Can anyone help? [CODE]import javax.swing.*; …

Member Avatar for mangopearapples
0
464

The End.