:: my frenz ::

:: leave ur link here ::

:: JAVA Programming : Susah OR Senang?? ::

salam.. wink2* ;)
JAVA PROGRAMMING...
susah OR senang???
bagi fara la kan.. da susah da senang...
mula2 memang la x pham stu apa pown..
bila wat x dpat lagi la asa cm nak gila..
tp bila kita wat.. n dapat result dy..
wah... hepi x terkata.. event benda 2 bnda besa ja..
owg kata "basic" la katakan..

nak tgk contoh coding dy x??
tp coding yg besa2 la.. yg x brapa nak pening kpala  la..


import javax.swing.JApplet; //import class JApplet
import java.awt.*; //Import package awt


public class exercise2 extends JApplet {
    public void paint (Graphics g)
    {
        super.paint(g); //call superclass version of method paint
        
        g.setColor(Color.MAGENTA); //set the color
        g.fillOval(30, 10, 180, 180); //draw an oval and fill it with color
        
        g.setColor(Color.BLACK); //set the color
        g.drawOval(30, 10, 180, 180); //draw an oval 
        
        g.setColor(Color.BLACK); //set the color
        g.drawOval(70, 40, 40, 40); //draw an oval 
        g.drawOval(130, 40, 40, 40); //draw an oval
        
        g.setColor(Color.BLACK); //set the color
        g.fillOval(80, 60, 20, 20); //draw an oval and fill it with color
        g.fillOval(140, 60, 20, 20); //draw an oval and fill it with color
        
        g.setColor(Color.WHITE); //set the color
        g.drawOval(80, 60, 20, 20); //draw an oval 
        g.drawOval(140, 60, 20, 20); //draw an oval
        
        g.setColor(Color.WHITE); //set the color
        g.fillRect(110,100,20,20); //draw the rectangle and fill it with color
        
        g.setColor(Color.BLACK); //set the color
        g.drawArc(70,110,100,40,0,-180); //draw an arc with its coordinate
        
        g.drawLine(65, 133, 75, 123); //draw the line
        g.drawLine(165, 123, 175, 133); //draw the line
  
    }
}
agak2 la kan.. apa output dy???
nak tau x..



comey x... 

:: thank's 4 reading ::

2 comments:

----- ----- said...

comey..
boleh ajar saya tak..


NINJA

farra miera said...

hehehe.. lau paham coding 2 bley la... insyaalllahhhh