<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'need the attention of a java programmer..' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'need the attention of a java programmer..' posted on the 'Java' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Thu, 20 Jun 2013 01:16:16 -0700</pubDate>
    <lastBuildDate>Thu, 20 Jun 2013 01:16:16 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>need the attention of a java programmer..</title>
      <link>http://www.programmersheaven.com/mb/java/419017/419017/need-the-attention-of-a-java-programmer/</link>
      <description>i am a student and new to java programming..&lt;br /&gt;
can yOu please heLp me to make my tank move?&lt;br /&gt;
just need it to go around the applet,&lt;br /&gt;
up, down, left and right directions.&lt;br /&gt;
please someone heLp!&lt;br /&gt;
here's the code for my tank:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
import javax.swing.*;
public class tank extends JApplet implements KeyListener{
int x1,x2;
int y1,y2;
int enemies,hits;
public void init(){
x1=0;
x2=0;
y1=0;
y2=0;
enemies=10;
hits=0;
resize(500,500);
}
public void paint(Graphics c){
c.setColor(Color.yellow);
c.fillRect(0,0,500,80);
c.setColor(Color.yellow);
c.fillRect(0,0,80,500);
c.setColor(Color.yellow);
c.fillRect(420,80,80,420);
c.setColor(Color.blue);
c.drawRect(180,320,150,150);
c.drawRoundRect(180,320,30,150,10,10);
c.drawRoundRect(210,345,90,100,10,10);
c.drawRoundRect(230,370,50,50,10,10);
c.drawRect(249,290,10,80);
c.drawRect(244,280,20,10);
c.drawRoundRect(300,320,30,150,10,10);
c.fillPolygon(x,y,3);
c.drawString("ENEMIES : " + enemies,50,30);
c.drawString("HITS : " + hits,375,30);
}
public void keyTyped(KeyEvent ev){}
public void keyReleased(KeyEvent ev){}
public void keyPressed(KeyEvent ev){}
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
please anyone heLp me..&lt;br /&gt;
teach me the missing lines of codes to make my program complete..&lt;br /&gt;
please.........&lt;br /&gt;
thanks in advance. :)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/java/419017/419017/need-the-attention-of-a-java-programmer/</guid>
      <pubDate>Thu, 07 Oct 2010 21:50:42 -0700</pubDate>
      <category>Java</category>
    </item>
    <item>
      <title>Re: need the attention of a java programmer..</title>
      <link>http://www.programmersheaven.com/mb/java/419017/419152/re-need-the-attention-of-a-java-programmer/#419152</link>
      <description>&lt;pre class="sourcecode"&gt;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class tank extends JApplet implements KeyListener
{
int x,y;
int enemies,hits;
private Color TANK_COLOR = new Color(0,100,0);

public void init()
{
  x=100;
  y=100;
  enemies=10;
  hits=0;
  resize(500,500);

  addKeyListener(this);
}

private void drawBackground(Graphics c)
{
  c.setColor(Color.yellow);
  c.fillRect(0,0,getWidth(),getHeight());
}

private void drawTank(Graphics c)
{
  c.setColor(TANK_COLOR);
  c.fillRect(x,y,10,10);
}

public void paint(Graphics c)
{
  drawBackground(c);
  drawTank(c);

  c.setColor(Color.BLACK);
  c.drawString("ENEMIES : " + enemies,50,30);
  c.drawString("HITS : " + hits,375,30);
}

private void moveDown()
{
  y+=10;
}

private void moveUp()
{
  y-=10;
}

private void moveLeft()
{
  x-=10;
}

private void moveRight()
{
  x+=10;
}

public void keyTyped(KeyEvent ev){}
public void keyReleased(KeyEvent ev){}
public void keyPressed(KeyEvent ev)
{
 int code = ev.getKeyCode();

  switch (code)
  {
    case 38: // up arrow
       moveUp();
       break;
    case 40: // down arrow
       moveDown();
       break;
    case 39: // right arrow
       moveRight();
       break;
    case 37: // left arrow
       moveLeft();
       break;
  }
  repaint();
}
}
&lt;/pre&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/java/419017/419152/re-need-the-attention-of-a-java-programmer/#419152</guid>
      <pubDate>Fri, 15 Oct 2010 16:52:25 -0700</pubDate>
      <category>Java</category>
    </item>
  </channel>
</rss>