<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Time for Blog</title>
	<atom:link href="http://kritvichaiwatanapanich.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kritvichaiwatanapanich.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 05 May 2008 13:21:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kritvichaiwatanapanich.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Time for Blog</title>
		<link>http://kritvichaiwatanapanich.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kritvichaiwatanapanich.wordpress.com/osd.xml" title="Time for Blog" />
	<atom:link rel='hub' href='http://kritvichaiwatanapanich.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Exercise 3.7</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/05/05/exercise-37/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/05/05/exercise-37/#comments</comments>
		<pubDate>Mon, 05 May 2008 13:21:40 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=55</guid>
		<description><![CDATA[1. Write the code segments that would draw the following objects in the graphics context g: a. A fillied rectangle with corner point (45,20) and size 100 by 50 -g.drawRect(45,20,100,50) b. A line segment with end points (20,20) and (100,100) -g.drawLine(20,20,100,100) c. A circle with center point (100,100) and radius 50 -g.drawOval(100,100,100,100) d. A triangle [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=55&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Write the code segments that would draw the following objects in the graphics context g:<br />
a. A fillied rectangle with corner point (45,20) and size 100 by 50<br />
-g.drawRect(45,20,100,50)<br />
b. A line segment with end points (20,20) and (100,100)<br />
-g.drawLine(20,20,100,100)<br />
c. A circle with center point (100,100) and radius 50<br />
-g.drawOval(100,100,100,100)<br />
d. A triangle with vertices(100,100),(50,50), and(200,200)<br />
-g.drawLine(100,100,50,50)<br />
-g.drawLine(50,50,200,200)<br />
-g.drawLine(200,200,100,100)</p>
<p>2. Describe the design of a program that displays a fillied blue rectangle on a red background.</p>
<p>public class ColorPanel extends JPanel{</p>
<p>public ColorPanel(Color backCoor){</p>
<p>setBackground(backColor);</p>
<p>}</p>
<p>public void paintComponent (Graphic g){</p>
<p>super.paintComponent(g);</p>
<p>int x = getWidth()/ 2-60</p>
<p>int y = getHeight() / 2;</p>
<p>g.setColor(Color.blue);</p>
<p>g.drawRect(x,y,120,20);</p>
<p>g.setColor(Color.red);</p>
<p>}<br />
3. How does one compute the center point of a panel?</p>
<p>youo can use   int x = getWidth() /2;</p>
<p>int y = getHeight() /2;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/55/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/55/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=55&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/05/05/exercise-37/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 2.7</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/04/24/exercise-27/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/04/24/exercise-27/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 13:39:48 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=53</guid>
		<description><![CDATA[1. WRITE THE INTEGER VALUES OF RED,GREEN, AND BLUE FOR THE FOLLOWING RGB COLORS: a. WHITE &#8211; new Color(255, 255, 255) b. BLACK &#8211; new Color(0, 0, 0) c. HIGHEST INTENSITY BLUE &#8211; (0, 0, 255) d. MEDIUM GRAY &#8211; (128, 128, 128) 2. DESCRIBE THE ROLES AND RESPONSIBILITIES OF A FRAME, A PANEL, AND [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=53&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. WRITE THE INTEGER VALUES OF RED,GREEN, AND BLUE FOR THE FOLLOWING RGB COLORS:<br />
a. WHITE &#8211; new Color(255, 255, 255)<br />
b. BLACK &#8211; new Color(0, 0, 0)<br />
c. HIGHEST INTENSITY BLUE &#8211; (0, 0, 255)<br />
d. MEDIUM GRAY &#8211; (128, 128, 128)<br />
2. DESCRIBE THE ROLES AND RESPONSIBILITIES OF A FRAME, A PANEL, AND A LAYOUT MANAGER IN A GUI APPLICATION.<br />
-A panel is a flat, rectagular area suitable for displaying other objects such as gemoetric shapes and images.<br />
-A Frame A Java class that defines the window for an application.<br />
-A Layout Manager is a border layout that allows us to arrange up to five objects in position that correspond to the directions north, east, south, west, and center.<br />
3. Where are panels displayed when a border layout is used to control their placement in a window?<br />
The panels will be displayed in South, North, West, East, or center.<br />
4. Write a code segment that would be used to set the layout for adding panels to a 5by5 grid in a  window. You may assume that the panel&#8217;s content pane is named pane.<br />
JFrame the GUI = new JFrame();<br />
theGUI.setTitle( &#8220;Pane&#8221; );<br />
JPanel panel1 = new JPanel();<br />
theGUI.setSize(300,200);<br />
Container pane = theGUI.getContentPane();<br />
pane.setLayout(new GridLayout(5,5);<br />
pane.add(panel1.setBackground(Color.white);<br />
pane.add(panel2.setBackground(Color.black);<br />
pane.add(panel3.setBackground(Color.grey);<br />
pane.add(panel4.setBackground(Color.red);<br />
pane.add(panel5.setBackground(Color.white);<br />
pane.add(panel6.setBackground(Color.black);<br />
pane.add(panel7.setBackground(Color.white);<br />
pane.add(panel8.setBackground(Color.black);<br />
pane.add(panel9.setBackground(Color.white);<br />
pane.add(panel10.setBackground(Color.black);<br />
pane.add(panel11.setBackground(Color.white);<br />
pane.add(panel12.setBackground(Color.black);<br />
pane.add(panel13.setBackground(Color.white);<br />
pane.add(panel14.setBackground(Color.black);<br />
pane.add(panel15.setBackground(Color.white);<br />
pane.add(panel16.setBackground(Color.black);<br />
pane.add(panel17.setBackground(Color.white);<br />
pane.add(panel18.setBackground(Color.black);<br />
pane.add(panel19.setBackground(Color.white);<br />
pane.add(panel20.setBackground(Color.black);<br />
pane.add(panel21.setBackground(Color.white);<br />
pane.add(panel22.setBackground(Color.black);<br />
pane.add(panel23.setBackground(Color.white);<br />
pane.add(panel24.setBackground(Color.black);<br />
pane.add(panel25.setBackground(Color.white);</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=53&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/04/24/exercise-27/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 9.7</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/02/29/exercise-97/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/02/29/exercise-97/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 13:20:57 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=52</guid>
		<description><![CDATA[1. What are two-dimensional arrays? two-array doesn&#8217;t only have one index to indicate the position in the array, but has two index of position to indicate row and column. 2. Describe an application in which a two-dimensional array might be used. 3. Write a code segment that searches a two-dimensional array for a negative integer. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=52&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. What are two-dimensional arrays?<br />
two-array doesn&#8217;t only have one index to indicate the position in the array, but has two index of position to indicate row and column.<br />
2. Describe an application in which  a two-dimensional array might be used.<br />
3. Write a code segment that searches a two-dimensional array for a negative integer. The loop should terminate at the first instance of a negative onteger in the array, and the variablees woe and col should be set to its position. Otherwise, the variable row and col should equal the number of rows and columns in the array(we assume that each row has the same number of columns).<br />
4. Describe the contents of the array after the following code segment is run:</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=52&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/02/29/exercise-97/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 9.6</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/02/28/exercise-96/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/02/28/exercise-96/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 14:32:02 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=51</guid>
		<description><![CDATA[1. What are parallel arrays? The parallel arrays allow the programmers to store the data that related to each other in the index. 2. Describe an application in which parallel arrays might be used. The application that its information or items have the same index. 3. Declare and instantiate the variables for parallel arrays to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=51&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. What are parallel arrays?<br />
The parallel arrays allow the programmers to store the data that related to each other in the index.<br />
2. Describe an application in which parallel arrays might be used.<br />
The application that its information or items have the same index.<br />
3. Declare and instantiate the variables for parallel arrays to track the names, ages, and social security numbers of 50 employees.<br />
String[] name = new String[50]<br />
int[]     age    = new int[50]<br />
int[]     secure= new int[50]</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=51&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/02/28/exercise-96/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 9.5</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/02/27/exercise-95/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/02/27/exercise-95/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 15:40:01 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=50</guid>
		<description><![CDATA[1.What happens when the programmer tries to access an array cell whose index is greater than or equal to its logical size? it will give you an error. 2. Describe an application that uses an array that might not be full. It will be more helpful since application will be able to accept more data [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=50&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1.What happens when the programmer tries to access an array cell whose index is greater than or equal to its logical size?<br />
it will give you an error.<br />
2. Describe an application that uses an array that might not be full.<br />
It will be more helpful since application will be able to accept more data from users.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=50&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/02/27/exercise-95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 9.4</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/02/15/exercise-94/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/02/15/exercise-94/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 16:18:58 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=49</guid>
		<description><![CDATA[1. Declare and instantiate array variables for the following data: a. An array of 15 doubles double[] abc = new double[15]; b. An array of 20 strings String[] abc = new String[20]; 2. What is an initializer list? Since array can be declared, instantiated in one step, the following is called &#8220;initializer list&#8221;. Ex. int [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=49&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Declare and instantiate array variables for the following data:<br />
a. An array of 15 doubles<br />
double[] abc = new double[15];<br />
b. An array of 20 strings<br />
String[] abc = new String[20];<br />
2. What is an initializer list?<br />
Since array can be declared, instantiated in one step, the following is called &#8220;initializer list&#8221;.<br />
Ex. int [] abc = {1,2,3,4,5}; // the 1st element in array &#8220;abc&#8221; will be 2.<br />
This is as same as abc[0] = 1;<br />
                          abc[1] = 2;<br />
3. Use an initialzer list to create the following arrays:<br />
a. five test scores of 100,,90,75,60, and 88<br />
int [] abc = {100,90,75,60,88};<br />
b. three interest rates of 0.12, 0.05, and 0.15<br />
double[] abc = { 0.12, 0.05, 0.15};<br />
c. two strings, your first name and last name<br />
string[] abc ={Krit, Vichaiwatanapanich}<br />
4. Why is it better to use the form []  instead of  []  when declaring an array variable?<br />
for the 1st type int aaa[], ccc[], bbb   // it means that you have to put &#8220;[]&#8221; for every after the variables that you want them array.<br />
for 2nd type int[] aaa, ccc, bbb // you don&#8217;t have to put &#8220;[]&#8221; everytime after the variable instead every variables you instantiate will be array.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/49/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/49/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=49&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/02/15/exercise-94/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 9.3</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-93/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-93/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 17:11:27 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=48</guid>
		<description><![CDATA[1. Write a loop that prints all of the items in an array &#8220;a&#8221; to the terminal screen. for ( int i = 0; i0 ; i &#8211;) System.out.println ( a[i]); 3. Write a loop that locates the first occurrence of a negative integer in an array a. When the loop is finished, the variable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=48&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Write a loop that prints all of the items in an array &#8220;a&#8221; to the terminal screen.<br />
for ( int i = 0; i<a>0 ; i &#8211;)<br />
     System.out.println ( a[i]);<br />
3. Write a loop that locates the first occurrence of a negative integer in an array a. When the loop is finished, the variable index should contain the index of the negative of the negative number or the length of the array if there were no negative numbers in the array.<br />
for ( int i = 0; i&lt; a.length-1 ; i ++)<br />
      if (a[i] &lt; 0);<br />
       break;</p>
<p>4. Describe what the following code segments do:<br />
a.instantiate  the integer i = 0, then while i is less than the length of the loop &#8220;a&#8221;,<br />
   print the ABS(element) in the index a  and i increase by 1.<br />
b.create String name str with no value<br />
   instantiate integer i = 0.<br />
   While i is less than length of the loop &#8220;a&#8221;,<br />
   the String str will equal to the initital string and include the element in the index.<br />
5. What is the advantage of using the instance variable length in a loop with an array?<br />
Because you will know the length of the loop, thus you will know when to stop.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/48/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/48/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=48&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-93/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 9.2</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-92/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-92/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 16:54:04 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=47</guid>
		<description><![CDATA[1. Assume that the array a contains the five integers 34, 23, 67, 89, and 12. Write the values of the following expressions. a. a[1] = 23 b. a[a.length -1] = 4 c. a[2] + a[3] = 67 + 89 = 156 2. What happens when a program attempts to access an item at an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=47&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Assume that the array a contains the five integers 34, 23, 67, 89, and 12. Write the values of the following expressions.<br />
a. a[1] = 23<br />
b. a[a.length -1] = 4<br />
c. a[2] + a[3] = 67 + 89 = 156<br />
2. What happens when a program attempts to access an item at an index that is less than o or greater than or equal to the array&#8217;s length?<br />
They will throw an &#8220;ArrayIndexOutOfBoundsException&#8221; because they are out of bounr (less than 0 or greater than or equal to array length). Sine the index is always 1 lesser than the array length because it starts at 0 instead of 1.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/47/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/47/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=47&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-92/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>Exercise 9.1</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-91/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-91/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 16:43:02 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=46</guid>
		<description><![CDATA[1. A program needs many variables to store and process data. How does an array solve this problem? Array is a data structure whose elements are accessed by index position. Ex. you don&#8217;t have to create many variables for many datas. 2. How does the programmer access an item in an array? They uses the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=46&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. A program needs many variables to store and process data. How does an array solve this problem?<br />
Array is a data structure whose elements are accessed by index position.<br />
Ex. you don&#8217;t have to create many variables for many datas.<br />
2. How does the programmer access an item in an array?<br />
They uses the index to indicate the item position.<br />
3. Mary is using an array of doubles to store an employee&#8217;s wage amounts for each day of the week(Mon.-Fri.). Draw a picture of this array with sample items and references to each one.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/46/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/46/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=46&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/02/14/exercise-91/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
		<item>
		<title>8.9 Applets</title>
		<link>http://kritvichaiwatanapanich.wordpress.com/2008/01/29/89-applets/</link>
		<comments>http://kritvichaiwatanapanich.wordpress.com/2008/01/29/89-applets/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 14:32:56 +0000</pubDate>
		<dc:creator>kritvichaiwatanapanich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kritvichaiwatanapanich.wordpress.com/?p=45</guid>
		<description><![CDATA[1. Describe the simplest format of an HTML applet tag. Give an example. An applet is a Java application that runs in a Web page. It contains HTML document that contains an applet markup tag and byte code file for the applet that is, a complied Java applet in a .classfile The applet markup tag [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=45&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Describe the simplest format of an HTML applet tag. Give an example.<br />
An applet is a Java application that runs in a Web page. It contains HTML document that contains an applet markup tag and byte code file for the applet that is, a complied Java applet in a .classfile<br />
The applet markup tag is ex<br />
2. How is an application converted to an applet?<br />
For application that use a apecialized view class for the main window, the conversion to an applet is surprisingly simple. We just do two things to this class:0<br />
-1. Replace the name JFrame with the name JApplet at the beginning of the class definition(extend JApplet).<br />
-2. Replace the class&#8217;s constructor by the method init:<br />
 public void init(){<br />
      &#8230;..<br />
 }<br />
3. What can an application do that an applet cannot do?<br />
There are several major difference between applets and applications.<br />
-To ensure security on the user&#8217;s machine, applets connot access files on that machine.<br />
-Applets and the HTML documents that use them should be placed in the same directory.<br />
-The programs in this book use Java 5.0, so only Web browsers that support Java 5.0 can run the applets in this chapter.<br />
The technique for using dialog boxes in applications, as discribed in CH4, applies to applets, with three qualifications: 1. The parent parameter of the dialog box&#8217;s consturctor should not be the applet , but null instead.<br />
                                               2. You might see a warning message at the bottom of the dialog box.<br />
                                               3. The dialog box soes not prevent you from returning to the web page. One there, you cannot interact with the applet, but you can browse to other pages, quit the browser, and perhaps hang up(lock up) the computer.<br />
4. Describe the steps required to load an image into an applet.<br />
-The images must reside on the Web server from which the applet&#8217;s byte code was sent. The JApplet method getDocumentBase() locates and returns the URL of the applet&#8217;s Web server. The JApplet method getImage expects this URL and the filename of an image as parameters. The method downloads the image from the Web server and returns an object of the class Image. This object can be converted to an ImageIcon object for further processing by using the ImageIcon(anImage) constructor.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kritvichaiwatanapanich.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kritvichaiwatanapanich.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kritvichaiwatanapanich.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kritvichaiwatanapanich.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kritvichaiwatanapanich.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kritvichaiwatanapanich.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kritvichaiwatanapanich.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kritvichaiwatanapanich.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kritvichaiwatanapanich.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kritvichaiwatanapanich.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kritvichaiwatanapanich.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kritvichaiwatanapanich.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kritvichaiwatanapanich.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kritvichaiwatanapanich.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kritvichaiwatanapanich.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kritvichaiwatanapanich.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kritvichaiwatanapanich.wordpress.com&amp;blog=1661036&amp;post=45&amp;subd=kritvichaiwatanapanich&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kritvichaiwatanapanich.wordpress.com/2008/01/29/89-applets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16aa84e33199e7dd7a91a775a53dddce?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kritvichaiwatanapanich</media:title>
		</media:content>
	</item>
	</channel>
</rss>
