Writing /home/infogasy/domains/wiki.infogasy.net/public_html/data/cache/3/3c0764f7fa92f216a243ea162e5502c2.xhtml failed

Applet

Ny applet dia laminasa kely anaty ny takelaka web. Rehefa atsoina io takelaka io dia mifindra ilay applet, avy any amin�ny lohamilina mankany amin�ilay niantso (Client). Aorinan�izany izy dia voafahana ary velona anatin�ny milina virtoaly Java, izay voafona anatin�ny Browser na AppletViewer .

Ny mahatsara azy io dia ahafana mameno ny banga misy eo amin�ny HTML, izany hoe ny fanaovana hetsika maro samihafa anatin�ny takelaka web iray.Raha amin�ny Poste local no tianao hanadramana azy dia refa manana Browser fotsiny ianao dia efa afaka mampiasa azy.

Ny indro kely amin�ny anefa dia izy ity tsy maintsy mifindra mihainga amin�ny lohamilina mankany amin�ny mpiantso, noho izay raha mavesabetsatra ny appletnao dia mety ho ela ela ihany vao hiseho izy. Ny olana manaraka koa dia ny fahafahan�ny olona maka ny zavatra vitanao izany hoe, atsakainy ny applet-nao Appletko.class dia hanaovan�ny olona reengineering, dia azony daholo ny code-nao. Izaho moa taloha ilay applet manetsika rano ireny no sitomiko dia voasako dia ampiasaiko amin�ny hilaivako azy.

Ity misy ohatra kely, raha te hanandrana hanamboatra applet ianao. Tsy mananosarotra ny fametrana applet anaty HTML, mampiasa balise applet fotsiny ianao toy izao :

 
<APPLET code="IlayApplet.class" width=400 height=300>
</APPLET>
 

Raha ohatra moa ka mampiasa parametre ilay applet dia ampiana balise PARAM toy izao :

 
<PARAM name="loko" value="manga"> 
 

IlayApplet.class moa zany ilay programa applet java.

Ity ny codeny IlayApplet.java

 
import java.awt.*;
import java.applet.*;
 
public class IlayApplet extends Applet {
 
   public void init() {
    setLayout(new BorderLayout());
    String loko=getParameter("loko");
 
  if (loko.equals("manga")) {setBackground(Color.blue);}
  if (loko.equals("mena")) {setBackground(Color.red);}
  
  add( new Label("Appletko voalohany",Label.CENTER)
        ,BorderLayout.CENTER);
 }
}
 

Jereo koa

Nandray anjara

 

applet.txt · Novaina farany:: 2008/09/11 12:43