Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

applet that does not print

Thread view: 
ananttickoo@gmail.com - 09 Aug 2006 07:50 GMT
hi
i was writing a applet that would take my key hit as input and print
it. but its not doing so. i can't find the bug. help me

Code:
import java.awt.event.*;
import java.applet.*;
import java.awt.*;
import java.lang.*;

public class buggy2 extends Applet
       implements KeyListener
{
   String msg="foo bar";

   public void paint(Graphics g)
   {
       g.drawString(msg,0,10);
       g.drawString(msg,10,10);
   }

   public void inti()
   {
    addKeyListener(this);
    requestFocus();

   }

  public void keyReleased(KeyEvent ke)
    {
        msg="hmmmmmm.";
repaint();
    }

    public void keyPressed(KeyEvent ke)
    {
                msg="type it";
repaint();
    }

   public void keyTyped(KeyEvent ke)
    {
        msg+=ke.getKeyChar();
        repaint();
    }
}
cp - 09 Aug 2006 09:44 GMT
Start by appropriately naming the init method of the applet from 'inti' to
'init'.
ananttickoo@gmail.com - 09 Aug 2006 10:36 GMT
> Start by appropriately naming the init method of the applet from 'inti' to
> 'init'.
i figured dat out thanks any ways


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.