Results 1 to 2 of 2

Thread: java problem

  1. #1
    casey is offline Member
    Join Date
    Mar 2011
    Rep Power

    Default java problem

    i want to display a message input by a user on an applet
    Java Code:
    * @(#)
    * Hello Applet application
    * @author
    * @version 1.00 2011/3/17
    import java.awt.*;
    import java.applet.*;
    public class Hello extends Applet {
    public void init() {
    public void paint(Graphics g) {
    BufferedReader keyboard;
    String Message;
    g.drawString("Enter message to be displayed:",0,20);
    keyboard = new BufferedReader(new InputStreamReader(;
    catch(IOException e){
    g.drawString("Error reading input!",0,40);
    g.drawString("Hello World!!!", 50, 60 );

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power


    You don't want to do your reading in your paint method like that.

    Instead, ask for input from the start method. Also, are you sure you have access to from an Applet? And is there a reason you're using an Applet instead of a JApplet?

    PS- In the future, you might want to use a more meaningful post title. Posts with titles like "java problem" tend to be ignored.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. Need Help!:( Java problem
    By ra21 in forum New To Java
    Replies: 2
    Last Post: 02-01-2011, 10:41 PM
  2. Problem Display Jmenubar Java Se6 u23 versus Java SE6 u22
    By Ravanelly in forum Advanced Java
    Replies: 0
    Last Post: 01-07-2011, 09:36 AM
  3. Java Problem. Need Help!
    By bob101 in forum New To Java
    Replies: 6
    Last Post: 03-19-2009, 04:34 AM
  4. Help, java problem
    By Suriman in forum New To Java
    Replies: 4
    Last Post: 03-09-2009, 04:26 PM
  5. Problem in java
    By saytri in forum New To Java
    Replies: 4
    Last Post: 01-16-2008, 10:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts