<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://uberthings.com/teaching/wiki/index.php?action=history&amp;feed=atom&amp;title=CanvasDemo</id>
	<title>CanvasDemo - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://uberthings.com/teaching/wiki/index.php?action=history&amp;feed=atom&amp;title=CanvasDemo"/>
	<link rel="alternate" type="text/html" href="https://uberthings.com/teaching/wiki/index.php?title=CanvasDemo&amp;action=history"/>
	<updated>2026-06-17T14:08:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://uberthings.com/teaching/wiki/index.php?title=CanvasDemo&amp;diff=1772&amp;oldid=prev</id>
		<title>Deprimer at 02:49, 6 February 2007</title>
		<link rel="alternate" type="text/html" href="https://uberthings.com/teaching/wiki/index.php?title=CanvasDemo&amp;diff=1772&amp;oldid=prev"/>
		<updated>2007-02-06T02:49:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:49, 5 February 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Overview ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Overview ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This MIDlet consists of two classes - CanvasDemo and MyCanvas.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This MIDlet consists of two classes - CanvasDemo and MyCanvas&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. It&#039;s a simple demonstration of creating basic animation on a Canvas&lt;/ins&gt;.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;CanvasDemo&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;CanvasDemo&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Deprimer</name></author>
	</entry>
	<entry>
		<id>https://uberthings.com/teaching/wiki/index.php?title=CanvasDemo&amp;diff=1771&amp;oldid=prev</id>
		<title>Deprimer at 02:46, 6 February 2007</title>
		<link rel="alternate" type="text/html" href="https://uberthings.com/teaching/wiki/index.php?title=CanvasDemo&amp;diff=1771&amp;oldid=prev"/>
		<updated>2007-02-06T02:46:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Overview ===&lt;br /&gt;
&lt;br /&gt;
This MIDlet consists of two classes - CanvasDemo and MyCanvas. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;CanvasDemo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;/*&lt;br /&gt;
 * CanvasDemo &lt;br /&gt;
 * by Michael Sharon&lt;br /&gt;
 * copyleft 2006&lt;br /&gt;
 * &lt;br /&gt;
 * Canvas using a Timer&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import javax.microedition.midlet.*;&lt;br /&gt;
import javax.microedition.lcdui.*;&lt;br /&gt;
&lt;br /&gt;
public class CanvasDemo extends MIDlet {&lt;br /&gt;
    &lt;br /&gt;
    private boolean boolMotion=true;    &lt;br /&gt;
    private int iX=10,iY=60;    &lt;br /&gt;
    &lt;br /&gt;
    Display mDisplay;&lt;br /&gt;
    Thread th;&lt;br /&gt;
    &lt;br /&gt;
    public void destroyApp(boolean unconditional){}&lt;br /&gt;
    &lt;br /&gt;
    public void pauseApp() {}&lt;br /&gt;
    &lt;br /&gt;
    public void startApp() {&lt;br /&gt;
        mDisplay = Display.getDisplay(this);&lt;br /&gt;
        final MyCanvas can = new MyCanvas();&lt;br /&gt;
        mDisplay.setCurrent(can);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MyCanvas&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;import javax.microedition.midlet.*;&lt;br /&gt;
import javax.microedition.lcdui.*;&lt;br /&gt;
&lt;br /&gt;
public class MyCanvas extends Canvas implements Runnable {&lt;br /&gt;
    int count;&lt;br /&gt;
    int h, w; &lt;br /&gt;
    &lt;br /&gt;
    public MyCanvas() {&lt;br /&gt;
    	h = getHeight(); &lt;br /&gt;
    	w = getWidth(); &lt;br /&gt;
        Thread th=new Thread(this);&lt;br /&gt;
        th.start();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //drawing on canvas&lt;br /&gt;
    public void paint(Graphics g) {&lt;br /&gt;
    	g.setColor(0,0,0);&lt;br /&gt;
    	g.fillRect(0,0,w,h); &lt;br /&gt;
        g.setColor(122,122,122);&lt;br /&gt;
        g.fillRect(0,count,40,40);&lt;br /&gt;
        g.drawString(&amp;quot;counter=&amp;quot;+count,60,20,g.TOP|g.LEFT);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //handling keyEvents&lt;br /&gt;
    protected void keyPressed(int keyCode) {&lt;br /&gt;
        repaint();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void run() {&lt;br /&gt;
        while(true) {&lt;br /&gt;
            count++;           &lt;br /&gt;
            repaint();&lt;br /&gt;
            count%=180;&lt;br /&gt;
        }        &lt;br /&gt;
    }    &lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Deprimer</name></author>
	</entry>
</feed>