Results 1 to 11 of 11
  1. #1
    prince24 is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Unhappy Help Me Out Guys

    i Am A Beginer In The Field Of Java.....my Question Is I M Using Jdk1.3 But The Programs On Awt Is Not Running On The Complier.so Do I Need To Download Extra Software/package For That.....even The Applet Programs R Not Running...help Me
    Last edited by JavaBean; 07-09-2007 at 05:23 PM. Reason: [b] tag removed from the post. prince24: please use case for your post. This is harder to read!!

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    Tell us detailed exception. What do you get when you try to run AWT applications?

  3. #3
    prince24 is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Default

    WHEN I TRY TO RUN THIS SIMPLE PROGRAM :

    import java.awt.*;
    import java.applet.*;

    <applet code="hourglass" width=230 height=210>
    </applet>

    public class hourglass extends Applet {

    public void paint(Graphics g) {
    int xpoints[]={30,200,30,200,30};
    int ypoints[]={30,30,200,200,30};
    int num=5;
    g.drawPolygon(xpoints,ypoints,num);
    }
    }


    AS SOON AS I GIVE THE COMMAND javac hourglass.java it says

    hourglass.java:4: 'class' or 'interface' expected
    <applet code="hourglass" width=230 height=210>
    ^
    1 error



    wat t do

  4. #4
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    I suggest you to read this applets tutorial before going on. :)

    You put HTML code inside your Java class. Those lines should be in an html file. When the compiler see those HTML lines, it gives error to you. Read the tutorial i sent. You will see your mistake.

  5. #5
    prince24 is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Default

    Thanks for ur valuable suggestion but now a new problem arise an applet is loaded on the desktop but it is blank and also it states that::::

    applet not initialized

    at the bottom of the applet.....

    m i wrong again at something????

  6. #6
    nehasahu is offline Member
    Join Date
    Jul 2007
    Posts
    5
    Rep Power
    0

    Default

    Hi Theres a mistake in your applet code
    <applet code="hourglass" width=230 height=210>
    </applet>

    instead of this there should be <applet code="hourglass.class" width=230 height=210>
    </applet>

    dont forget to put .class extension otherwise your program wont work.....

  7. #7
    prince24 is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Default

    thanks neha for ur help i tried wat u pointed out but the problem still persists

    :( :( :(

  8. #8
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    The applet should return an exception. You need to learn the details about the exception. What is it and which line the exception is being thrown? These details should be shown on Java Console. Check following resources:

    Java Plug-in Console
    Enable and View Java Console Window - 1.4.2_xx

    After knowing the details about the exception, we can advise you a solution.

  9. #9
    nehasahu is offline Member
    Join Date
    Jul 2007
    Posts
    5
    Rep Power
    0

    Default

    You know your program is perfect I ran it on my machine and its giving me the output without any error.

    do one thing make a new file and then copy and paste ur prog and then run it

  10. #10
    prince24 is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Default

    Thanks Neha But I Would Be Glad If U Could Tell Me What Commant U Gave To Run The Program

  11. #11
    prince24 is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Talking

    Oops I Got It Correct This Time.....

    Thanks Neha And Javabean

    :d :d :d :d :d

Similar Threads

  1. Hello Guys
    By angelijie in forum Introductions
    Replies: 9
    Last Post: 05-23-2008, 12:18 PM
  2. Hi Guys
    By gibsonsydsa in forum Introductions
    Replies: 1
    Last Post: 02-06-2008, 06:36 AM
  3. hi guys!!!
    By surenani in forum Introductions
    Replies: 4
    Last Post: 01-23-2008, 05:24 AM
  4. Hie guys
    By heat84 in forum Introductions
    Replies: 1
    Last Post: 12-20-2007, 06:50 AM
  5. Hello guys
    By tharindu in forum Introductions
    Replies: 0
    Last Post: 11-26-2007, 07:58 AM

Posting Permissions

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