KeyListener problem

Posted by rgksugan on Stack Overflow See other posts from Stack Overflow or by rgksugan
Published on 2010-05-14T05:44:03Z Indexed on 2010/05/14 7:04 UTC
Read the original article Hit count: 327

Filed under:
|
|
|

In my apllication i am using a jpanel in which i want to add a key listener. I did it. But it doesnot work.

Is it because i am using a swingworker to update the contents of the panel every second.

Here is my code to update the panel

RenderedImage image = ImageIO.read(new ByteArrayInputStream((byte[]) get()));
        Graphics graphics = remote.rdpanel.getGraphics();
        if (graphics != null) {
            Image readyImage = new ImageIcon(UtilityFunctions.convertRenderedImage(image)).getImage();
            graphics.drawImage(readyImage, 0, 0, remote.rdpanel.getWidth(), remote.rdpanel.getHeight(), null);
        }

© Stack Overflow or respective owner

Related posts about java

Related posts about jpanel