Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-09-2007, 06:20 PM
Member
 
Join Date: Jul 2007
Posts: 9
prince24 is on a distinguished road
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 06:23 PM. Reason: [b] tag removed from the post. prince24: please use case for your post. This is harder to read!!
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-09-2007, 09:25 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Tell us detailed exception. What do you get when you try to run AWT applications?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-10-2007, 08:29 AM
Member
 
Join Date: Jul 2007
Posts: 9
prince24 is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-10-2007, 01:46 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-11-2007, 03:18 AM
Member
 
Join Date: Jul 2007
Posts: 9
prince24 is on a distinguished road
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????
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 07-11-2007, 04:29 AM
Member
 
Join Date: Jul 2007
Posts: 5
nehasahu is on a distinguished road
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.....
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 07-12-2007, 11:38 AM
Member
 
Join Date: Jul 2007
Posts: 9
prince24 is on a distinguished road
thanks neha for ur help i tried wat u pointed out but the problem still persists

Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 07-12-2007, 12:04 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 07-13-2007, 08:23 AM
Member
 
Join Date: Jul 2007
Posts: 5
nehasahu is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 07-13-2007, 03:04 PM
Member
 
Join Date: Jul 2007
Posts: 9
prince24 is on a distinguished road
Thanks Neha But I Would Be Glad If U Could Tell Me What Commant U Gave To Run The Program
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 07-13-2007, 05:52 PM
Member
 
Join Date: Jul 2007
Posts: 9
prince24 is on a distinguished road
Oops I Got It Correct This Time.....

Thanks Neha And Javabean

:d :d :d :d :d
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello Guys angelijie Introductions 9 05-23-2008 01:18 PM
Hi Guys gibsonsydsa Introductions 1 02-06-2008 07:36 AM
hi guys!!! surenani Introductions 4 01-23-2008 06:24 AM
Hie guys heat84 Introductions 1 12-20-2007 07:50 AM
Hello guys tharindu Introductions 0 11-26-2007 08:58 AM


All times are GMT +3. The time now is 10:17 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org