Java programming

Software and Operating Systems. Feel free to ask tech support questions, we're happy to help!

Moderator: Moderators

Java programming

Postby lumpyleg on Wed Jul 09, 2008 10:40 pm

So now mr baric has given us a few starters lets post some of the stuff we have created our self in bluejay or whatever. :geek:

A nice sequence of the moon.


Code: Select all
import java.applet.*;
import java.awt.*;

public class poo extends Applet

{
 
public void paint (Graphics g)
  {
     

setBackground(Color.black);

Color ass = new Color(255,255,255);
g.setColor(ass);


g.fillOval(20,200,100,100);
g.fillOval(130,200,100,100);
g.fillOval(240,200,100,100);
g.fillOval(350,200,100,100);
g.fillOval(460,200,100,100);
g.fillOval(570,200,100,100);
g.fillOval(680,200,100,100);
g.fillOval(790,200,100,100);
//g.fillOval(900,200,100,100);
//g.fillOval(1010,200,100,100);
//g.fillOval(1120,200,100,100);

Color pooo = new Color(0,0,0);
g.setColor(pooo);

//g.fillOval(20,200,100,100);
g.fillOval(30,200,100,100); // 1

//g.fillOval(130,200,100,100);
g.fillOval(150,200,90,100); // 2

//g.fillOval(240,200,100,100);
g.fillOval(270,200,80,100); // 3

//g.fillOval(350,200,100,100);
g.fillOval(390,200,70,100); //4

//g.fillOval(460,200,100,100);
g.fillOval(510,200,60,100); // 5

//g.fillOval(570,200,100,100);
g.fillOval(630,200,50,100); // 7

//g.fillOval(680,200,100,100);
g.fillOval(750,200,40,100); //8

//g.fillOval(790,200,100,100);
g.fillOval(800,100,100,100); //9



//g.fillOval(900,200,100,100);
//g.fillOval(1010,200,100,100);
//g.fillOval(1120,200,100,100);
 
}

}
User avatar
lumpyleg
Contributor
 
Posts: 44
Joined: Fri Apr 18, 2008 6:59 pm

Re: Java programming

Postby lumpyleg on Wed Jul 09, 2008 10:51 pm

messing around witth differnt fonts, bolds and paint options


Code: Select all
import java.applet.*;
import java.awt.*;

public class HelloWorld extends Applet
{
 
public void paint (Graphics g)
  {
     
      setBackground(Color.gray); //backgroun
     
 
   
      Color poo = new Color(255,133,60);
      g.setColor(poo); //colour
     
      Font s**t = new Font("Courier", Font.BOLD, 50);
      g.setFont(s**t); //font
     
      g.drawString("Hello World!",70, 200); //hello world
     
      Font ass = new Font("Dialog", Font.ITALIC, 50);
      g.setFont(ass); //font
     
      Color grass = new Color(0,133,60);
      g.setColor(grass);
       //grass top  (left to right, top to bottom, right to left,thick)
     
      g.setColor(grass);
      g.fillRect(0,400,500,100); //grass bottom

      Color it = new Color(0,0,0);
      g.setColor(it);
     


}

}
User avatar
lumpyleg
Contributor
 
Posts: 44
Joined: Fri Apr 18, 2008 6:59 pm

Re: Java programming

Postby bennyling on Fri Jul 11, 2008 5:52 pm

Awesome work, lumpyleg!

I'll post some of my work when I'm motivated enough to create something cool, but for now, you can use the Image
[ code ] [ /code ] tages (without the spaces) to display your code :ugeek:
User avatar
bennyling
Whoa!
 
Posts: 99
Joined: Tue Jan 22, 2008 10:59 pm
Location: Blackmans Bay, TAS


Return to Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron