Listener « Applet « Java Swing Q&A





2. Using KeyListener in an applet    coderanch.com

import java.awt.*; import java.awt.event.*; import java.awt.event.KeyEvent; import java.awt.image.*; import java.awt.font.*; import java.awt.geom.*; import java.awt.Color; import javax.swing.*; import java.util.*; public class PacmanGame extends JPanel implements KeyListener { // CONSTRUCTOR public PacmanGame() { } protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.drawLine(50,50,100,100); } public void keyPressed(KeyEvent e) { System.out.println("KEY PRESSED"); } public void keyReleased(KeyEvent e){} public void keyTyped(KeyEvent ...

3. applets action listeners not working    coderanch.com

hi, i have a sipphone GUI in applets. the code is working fine in eclipse.. it is not running fine from tomcat server.. i know that eclipse has nothing to do with the tomcat server.... i was able to load the applet in tomcat server ( the GUI is appearing).. now the problem is, i have some 10 JButtons in the ...