<?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>Ankit Virparia &#187; GTU Question</title>
	<atom:link href="http://ankit.co/tag/gtu-question/feed" rel="self" type="application/rss+xml" />
	<link>http://ankit.co</link>
	<description>A Programmer, Designer and Trainer</description>
	<lastBuildDate>Sun, 11 May 2014 04:15:47 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>Colorful Equal Bars</title>
		<link>http://ankit.co/tutorials/java-tutorials/applet/colorful-equal-bars?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=colorful-equal-bars</link>
		<comments>http://ankit.co/tutorials/java-tutorials/applet/colorful-equal-bars#comments</comments>
		<pubDate>Sun, 06 Jan 2013 05:26:03 +0000</pubDate>
		<dc:creator><![CDATA[Ankit Virparia]]></dc:creator>
				<category><![CDATA[Applet]]></category>
		<category><![CDATA[GTU Question]]></category>

		<guid isPermaLink="false">http://ankit.co/?p=195</guid>
		<description><![CDATA[<p>Definition: Write an applet that draws four Vertical bars of equal size &#038; of different colors such that they cover up the whole applet area. The applet should operate correctly even if it is resized. Code: Output:</p>
<p>The post <a rel="nofollow" href="http://ankit.co/tutorials/java-tutorials/applet/colorful-equal-bars">Colorful Equal Bars</a> appeared first on <a rel="nofollow" href="http://ankit.co">Ankit Virparia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h3>Definition:</h3>
<p>Write an applet that draws four Vertical bars of equal size &#038; of different colors such that they cover up the whole applet area. The applet should operate correctly even if it is resized.</p>
<p>Code:</p>
<pre class="brush: java; title: ; notranslate">
import java.applet.*;
import java.awt.*;

public class equalBars extends Applet
{
	Color[] clr = {Color.red, Color.green, Color.pink, Color.blue};
	int cnt = 0;
	public void init()
	{
		setBackground(Color.black);	
	}
	
	public void paint(Graphics g)
	{
		int w = getWidth();
		int h = getHeight();
		
		for(int i=0;i&lt;4;i++)
		{
			g.setColor(clr[i]);
			g.fillRect(w/4*i,0,w/4,h);
		}
	}	
	
}

/*
&lt;applet code=&quot;equalBars&quot; width=&quot;500&quot; height=&quot;500&quot;&gt;&lt;/applet&gt;
*/
</pre>
<p><strong>Output:</strong><br />
<a href="http://ankit.co/wp-content/uploads/2013/01/p6.jpg"><img src="http://ankit.co/wp-content/uploads/2013/01/p6.jpg" alt="p6" width="500" height="500" class="aligncenter size-full wp-image-3545" /></a></p>
<p>The post <a rel="nofollow" href="http://ankit.co/tutorials/java-tutorials/applet/colorful-equal-bars">Colorful Equal Bars</a> appeared first on <a rel="nofollow" href="http://ankit.co">Ankit Virparia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankit.co/tutorials/java-tutorials/applet/colorful-equal-bars/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
