faqts : Computers : Programming : Languages : Java : IDE Related : Eclipse

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

33 of 87 people (38%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

Java: IDE: Eclipse: Applet: How to create a Hello World applet in Eclipse?

Apr 19th, 2006 16:54
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 19 April 2021 - 11:53 pm ----------------------
Java: IDE: Eclipse: Applet: How to create a Hello World applet in 
Eclipse?
===
Steps: Overview:
 1. -Start the program 'Eclipse'
 2. -Create a new project
     1. -Select from menu option 'File'
     2. -Select from list 'New'
     3. -Select from list 'Project'
     4. -Select from list 'Java Project'
     5. -Click button 'Next'
 3. -Choose a project name
     1. -E.g.
          HelloWorld
 4. -Click button 'Finish'
 5. -Create a class
     1. -Select from menu option 'File'
     2. -Select from list 'New'
     3. -Select from list 'Class'
     4. -Choose a 'name'
         1. -E.g.
              HelloWorld
    5. -Click button 'Finish'
 6. -Fill the following source code
--- cut here: begin --------------------------------------------------
import java.applet.*;
import java.awt.*;
//
public class HelloWorld extends Applet
 {
 //
 public void paint( Graphics graphics1 ) {
  graphics1.drawString( "Hello world!", 0, 30 );
  }
 }
--- cut here: end ----------------------------------------------------
 7. -Run the applet
     1. -Select from menu option 'Run'
     2. -Select from list 'Run As'
     3. -Select from list 'Java Applet'
     4. -Click button 'OK'
  8. -That will open the applet viewer window
      showing
--- cut here: begin --------------------------------------------------
 Hello World
--- cut here: end ----------------------------------------------------
===
Tested successfully on
Microsoft Windows XP Professional (service pack 2),
running
Eclipse v3.1.1
===
Internet: see also:
---
Java: IDE: Eclipse: Link: Overview: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/40633/fid/1778
----------------------------------------------------------------------