<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Java Interview Questions &#187; Applets Tutorial</title>
	<atom:link href="http://www.bestjavainterviewquestions.com/category/java-important-notes/applets-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bestjavainterviewquestions.com</link>
	<description>Java Interview Questions &#124; Core Java Interview Questions &#124; Advanced Java Interview Questions &#124; EJB Interview Questions &#124; J2EE Interview Questions &#124; Hibernate Interview Questions</description>
	<lastBuildDate>Fri, 03 Feb 2012 10:23:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Some important methos in Applets</title>
		<link>http://www.bestjavainterviewquestions.com/some-important-methos-in-applets/</link>
		<comments>http://www.bestjavainterviewquestions.com/some-important-methos-in-applets/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 20:08:14 +0000</pubDate>
		<dc:creator>Ramakrishna</dc:creator>
				<category><![CDATA[Applets Tutorial]]></category>
		<category><![CDATA[important applet methods]]></category>

		<guid isPermaLink="false">http://www.bestjavainterviewquestions.com/?p=112</guid>
		<description><![CDATA[Applet methods: public void init () public void start () public void stop () public void destroy () public void paint (Graphics) Also: public void repaint() public void update (Graphics) public void showStatus(String) public String getParameter(String) repaint( ) method: Call repaint( ) when you have changed something and want your changes to show up on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Applet methods</strong>:</p>
<p>public void init ()<br />
public void start ()<br />
public void stop ()<br />
public void destroy ()<br />
public void paint (Graphics)<br />
Also:<br />
public void repaint()<br />
public void update (Graphics)<br />
public void showStatus(String)<br />
public String getParameter(String)</p>
<p><strong>repaint( ) method:</strong><br />
Call repaint( ) when you have changed something and want your changes to show up on the screen<br />
repaint( ) is a request&#8211;it might not happen<br />
When you call repaint( ), Java schedules a call to update(Graphics g)</p>
<p><strong>update( ) method:</strong><br />
When you call repaint( ), Java schedules a call to update(Graphics g)<br />
Here&#8217;s what update does:<br />
public void update(Graphics g) {    // Fills applet with background color, then    paint(g);}</p>
<p><strong>Sample Graphics methods:</strong></p>
<p>&#8211;&gt;A Graphics is something you can paint on<br />
&#8211;&gt;g.drawString(“Hello”, 20, 20);<br />
&#8211;&gt;g.drawRect(x, y, width, height);<br />
&#8211;&gt;g.fillRect(x, y, width, height);<br />
&#8211;&gt;g.drawOval(x, y, width, height);<br />
&#8211;&gt;g.fillOval(x, y, width, height);<br />
&#8211;&gt;g.setColor(Color.red);</p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li>September 20, 2008 -- <a href="http://www.bestjavainterviewquestions.com/define-session-hijacking-2/" title="Define Session Hijacking">Define Session Hijacking</a> (0)</li><li>February 15, 2009 -- <a href="http://www.bestjavainterviewquestions.com/providing-current-date-and-time-using-stateless-session-bean/" title="Providing current date and time using Stateless session bean">Providing current date and time using Stateless session bean</a> (0)</li><li>October 3, 2008 -- <a href="http://www.bestjavainterviewquestions.com/jsp-scriplets-and-templets/" title="Jsp Scriplets and Templets">Jsp Scriplets and Templets</a> (0)</li><li>September 2, 2008 -- <a href="http://www.bestjavainterviewquestions.com/define-httpsession-class/" title="Define HttpSession Class">Define HttpSession Class</a> (0)</li><li>October 3, 2008 -- <a href="http://www.bestjavainterviewquestions.com/explain-jsp-declaration/" title="Explain JSP Declaration">Explain JSP Declaration</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.bestjavainterviewquestions.com/some-important-methos-in-applets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Applets</title>
		<link>http://www.bestjavainterviewquestions.com/applets-tutorial-with-some-important-methods/</link>
		<comments>http://www.bestjavainterviewquestions.com/applets-tutorial-with-some-important-methods/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 19:37:46 +0000</pubDate>
		<dc:creator>Ramakrishna</dc:creator>
				<category><![CDATA[Applets Tutorial]]></category>
		<category><![CDATA[knowing of applets]]></category>

		<guid isPermaLink="false">http://www.bestjavainterviewquestions.com/?p=109</guid>
		<description><![CDATA[How to use Applets 1)&#8211;&#62;An applet is a Panel that allows interaction with a Java program A applet is typically embedded in a Web page and can be run from a browser You need special HTML in the Web page to tell the browser about the applet For security reasons, applets run in a sandbox: [...]]]></description>
			<content:encoded><![CDATA[<p><strong>How to use Applets</strong></p>
<p>1)&#8211;&gt;An applet is a Panel that allows interaction with a Java program<br />
A applet is typically embedded in a Web page and can be run from a browser<br />
You need special HTML in the Web page to tell the browser about the applet<br />
For security reasons, applets run in a sandbox: they have no access to the client’s file system</p>
<p>2)&#8211;&gt;Most modern browsers support Java 1.4 if they have the appropriate plugin<br />
In the PC labs, Internet Explorer 5.5 has been updated, but Netscape has not<br />
The best support isn&#8217;t a browser, but the standalone program appletviewer<br />
In general you should try to write applets that can be run with any browser</p>
<p>3)&#8211;&gt;You write an applet by extending the class Applet<br />
Applet is just a class like any other; you can even use it in applications if you want<br />
When you write an applet, you are only writing part of a program<br />
The browser supplies the main method</p>
<p><strong>The simplest possible applet</strong>:</p>
<p><em>TrivialApplet.java</em></p>
<p>import java.applet.Applet;<br />
public class TrivialApplet extends Applet { }</p>
<p><em>TrivialApplet.html</em></p>
<p>&lt;applet    code=&#8221;TrivialApplet.class”    width=150 height=100&gt;<br />
&lt;/applet&gt;</p>
<p><!--[if !mso]><br />
<mce:style><!  v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --></p>
<p><!--[endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:DoNotShowRevisions /> <w:DoNotPrintRevisions /> <w:DoNotShowMarkup /> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> &lt;!&#8211;  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&#8221;"; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&#8221;Times New Roman&#8221;; 	mso-fareast-font-family:&#8221;Times New Roman&#8221;;} @page Section1 	{size:8.5in 11.0in; 	margin:333.0pt 3.0in 333.0pt 3.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} &#8211;&gt; <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman";} --></p>
<p><!--[endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1026" style="mso-wrap-style:none" mce_style="mso-wrap-style:none"   fillcolor="none [4]" strokecolor="none [1]"> <v:fill color="none [4]" color2="none [0]" /> <v:stroke color="none [1]" weight=".25pt" /> <v:shadow color="none [2]" /> <o:colormru v:ext="edit" colors="red,#ff7c80,#9cf,#ff9" /> <o:colormenu v:ext="edit" fillcolor="red" strokecolor="none [1]"    shadowcolor="none [2]" /> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1" /> </o:shapelayout></xml><![endif]--><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;"><!--[if gte vml 1]><v:shapetype id="_x0000_t75"  coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"  filled="f" stroked="f"> <v:stroke joinstyle="miter" /> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0" /> <v:f eqn="sum @0 1 0" /> <v:f eqn="sum 0 0 @1" /> <v:f eqn="prod @2 1 2" /> <v:f eqn="prod @3 21600 pixelWidth" /> <v:f eqn="prod @3 21600 pixelHeight" /> <v:f eqn="sum @0 0 1" /> <v:f eqn="prod @6 1 2" /> <v:f eqn="prod @7 21600 pixelWidth" /> <v:f eqn="sum @8 21600 0" /> <v:f eqn="prod @7 21600 pixelHeight" /> <v:f eqn="sum @10 21600 0" /> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" /> <o:lock v:ext="edit" aspectratio="t" /> </v:shapetype><v:shape id="_x0000_s1024" type="#_x0000_t75" style='width:180pt;  height:126pt;mso-position-horizontal:absolute;  mso-position-horizontal-relative:char;mso-position-vertical:absolute;  mso-position-vertical-relative:line' fillcolor="#f90" strokecolor="white"  strokeweight="1pt"> <v:fill color2="#006" /> <v:stroke startarrowwidth="narrow" startarrowlength="short" endarrowwidth="narrow"   endarrowlength="short" /> <v:imagedata src="file:///C:\DOCUME~1\RAMAKR~1\LOCALS~1\Temp\msohtml1\12\clip_image001.png" mce_src="file:///C:\DOCUME~1\RAMAKR~1\LOCALS~1\Temp\msohtml1\12\clip_image001.png"   o:title="" /> <v:shadow color="black" /> <w:wrap type="none" side="left" /> <w:anchorlock /> </v:shape><![endif]--><!--[if !vml]--><!--[endif]--></span></p>
<p>The above are the sample programs for you to know how to run an applet</p>
<p>First we have write the code in the java by saving the file with an .java extension and then compile that file by that extension, you will get the .class file from that</p>
<p>After getting the class file you just embedd that .class path in the &lt;applet code=&#8221;"&gt; .It can be used in two ways just place the above code in your java file itself (or)</p>
<p>You can write the .html file to run the above java file using the above applet code in the html file</p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li>August 24, 2008 -- <a href="http://www.bestjavainterviewquestions.com/how-many-ejb-objects-are-created-for-a-bean/" title="How many EJB Objects are created for a Bean">How many EJB Objects are created for a Bean</a> (0)</li><li>October 5, 2008 -- <a href="http://www.bestjavainterviewquestions.com/can-we-provide-a-constructor-in-the-servlet-class/" title="Can we provide a constructor in the servlet class">Can we provide a constructor in the servlet class</a> (0)</li><li>September 2, 2008 -- <a href="http://www.bestjavainterviewquestions.com/define-create-session-and-sessionfactory/" title="Define create Session and SessionFactory">Define create Session and SessionFactory</a> (0)</li><li>July 7, 2008 -- <a href="http://www.bestjavainterviewquestions.com/java-rmi-interview-questions/" title="Java RMI Interview questions">Java RMI Interview questions</a> (0)</li><li>September 7, 2008 -- <a href="http://www.bestjavainterviewquestions.com/define-cookie-poisoning/" title="Define Cookie Poisoning">Define Cookie Poisoning</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.bestjavainterviewquestions.com/applets-tutorial-with-some-important-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

