Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
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-18-2007, 07:17 PM
Member
 
Join Date: Jul 2007
Posts: 35
silvia is on a distinguished road
I need simple java applet
Hi, I was wondering if someone can show me how to make a simple java applet with some buttons like submit and reset and maybe some others?

Thanks.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-07-2007, 07:42 AM
Member
 
Join Date: Jul 2007
Posts: 40
barney is on a distinguished road
Check this:
chapter1
Decent tutorials to get started with and it shows you source code to look at.
Greetings.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-01-2008, 02:23 PM
Member
 
Join Date: Jan 2008
Posts: 2
thejdev is on a distinguished road
Hi i'm a newbie and i tried that hello world example except that i renamed it to HelloApplet.java . I tried to view it on a html page using hotjava 3.0 and i get these exceptions when i do

PHP Code:
?HelloApplet.class?:


java.lang.ClassNotFoundException: ?HelloApplet.class?

    
at sunw.hotjava.applet.BasicAppletManager.createApplet(BasicAppletManager.java:245)

    
at sunw.hotjava.applet.BrowserAppletManager.createApplet(BrowserAppletManager.java:109)

    
at sunw.hotjava.applet.AppletPanel.runLoader(AppletPanel.java:480)

    
at sunw.hotjava.applet.AppletPanel.processEvent(AppletPanel.java:338)

    
at sunw.hotjava.applet.AppletPanel.run(AppletPanel.java:323)

    
at java.lang.Thread.run(Thread.java:466
My HTML document looks like this (html.html)

PHP Code:
<HTML>
<
HEAD>
<
TITLE>This page has an applet on it</TITLE>
</
HEAD>
<
BODY>
<
P>My second Java applet says:
<
BR>
<
APPLET CODE ”HelloApplet.class” WIDTH=200 HEIGHT=50>
There would be an applet here if your browser
supported Java
.
</
APPLET>
</
BODY>
</
HTML
And my HelloApplet.java :

PHP Code:
/* 
By Bavo Bruylandt (Http://www.realapplets.com") 
*/ 

// and now The inevidable "Hello World" example :) 

// tell the compiler where to find the methods you will use. 
// required when you create an applet 
import java.applet.*; 
// required to paint on screen 
import java.awt.*; 
  

// the start of an applet - HelloWorld will be the executable class 
// Extends applet means that you will build the code on the standard Applet class 
public class HelloApplet extends Applet 


// The method that will be automatically called  when the applet is started 
     
public void init() 
     { 
 
// It is required but does not need anything. 
     

  

// This method gets called when the applet is terminated 
// That's when the user goes to another page or exits the browser. 
     
public void stop() 
     { 
     
// no actions needed here now. 
     

  

// The standard method that you have to use to paint things on screen 
// This overrides the empty Applet method, you can't called it "display" for example. 

     
public void paint(Graphics g
     { 
 
//method to draw text on screen 
 // String first, then x and y coordinate. 
      
g.drawString("Hey hey hey",20,20); 
      
g.drawString("Hellooow World",20,40); 

     } 


  

// That's it. Next is drawing special shapes on screen and using fonts. 
// Go to DrawExample.java. 
I compiled HelloApplet.java on Forte for Java 4.0 CE

All files i.e HelloApplet.java , HelloApplet.class and html.html are in the same directory i.e C:\forte_jdk\forte4j\bin\ide-userdir\sampledir

Could someone pls tell me where i went wrong ...
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-01-2008, 02:54 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,545
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Have you check that code as it is?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-27-2008, 09:50 AM
Member
 
Join Date: Jan 2008
Posts: 6
sabbirhs is on a distinguished road
hi try to compile it from tha console. javac *.*
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
2 simple java questions jimJohnson New To Java 2 02-02-2008 11:35 AM
Simple java abhiN New To Java 0 01-16-2008 04:44 PM
Simple java abhiN New To Java 1 01-16-2008 12:13 PM
help with simple program in java katie New To Java 2 08-06-2007 10:03 PM
help with simple java program leonard New To Java 3 07-30-2007 11:40 AM


All times are GMT +3. The time now is 07:20 AM.


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