Monday, 20 November 2017
Wednesday, 15 November 2017
java graphical prjects
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=16,s=30,d=400,f=400,h=1,j=1,k=1,l=1;
for(int i=0;i<14;i++)
{
Ellipse2D.Double R= new Ellipse2D.Double(d,s,d,f);
g2.draw(R);
Rectangle E= new Rectangle(s,s,a,f);
g2.draw(E);
if(i%2==0)
{ g2.setColor(Color.BLACK);
g2.fill(R);
}
if(i%2==1){
g2.setColor(Color.green
);
g2.fill(E);}
if(i%2==0)
{ g2.setColor(Color.yellow);
g2.fill(E);}
if(i%2==1)
{ g2.setColor(Color.red);
g2.fill(R);
}
a+=14;s+=14;d-=30;f-=30;
h+=1;j+=1;k+=1;l+=1;
}}
}
Output is
java graphics projects
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=16,s=30,d=400,f=400,h=1,j=1,k=1,l=1;
for(int i=0;i<14;i++)
{
Ellipse2D.Double R= new Ellipse2D.Double(s,s,d,f);
g2.draw(R);
Rectangle E= new Rectangle(h,s,d,f);
g2.draw(E);
if(i%2==0)
{ g2.setColor(Color.BLACK);
g2.fill(R);
}
if(i%2==1){
g2.setColor(Color.green
);
g2.fill(E);}
if(i%2==0)
{ g2.setColor(Color.yellow);
g2.fill(E);}
if(i%2==1)
{ g2.setColor(Color.red);
g2.fill(R);
}
a+=14;s+=14;d-=30;f-=30;
h+=1;j+=1;k+=1;l+=1;
}}
}
Output is
java full 3d drawings
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=16,s=30,d=400,f=400,h=1,j=1,k=1,l=1;
for(int i=0;i<14;i++)
{
Ellipse2D.Double R= new Ellipse2D.Double(1,s,d,f);
g2.draw(R);
Rectangle E= new Rectangle(a,l,d,f);
g2.draw(E);
if(i%2==0)
{ g2.setColor(Color.BLACK);
g2.fill(R);
}
if(i%2==1){
g2.setColor(Color.green
);
g2.fill(E);}
if(i%2==0)
{ g2.setColor(Color.yellow);
g2.fill(E);}
if(i%2==1)
{ g2.setColor(Color.red);
g2.fill(R);
}
a+=14;s+=14;d-=30;f-=30;
h+=1;j+=1;k+=1;l+=1;
}}
}
Output is
java 3d drawing top 10 programs
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=16,s=30,d=400,f=400;
for(int i=0;i<14;i++)
{
Ellipse2D.Double R= new Ellipse2D.Double(a,s,d,f);
g2.draw(R);
Rectangle E= new Rectangle(a,s,d,f);
g2.draw(E);
if(i%2==0)
{ g2.setColor(Color.BLACK);
g2.fill(R);
}
if(i%2==1){
g2.setColor(Color.green
);
g2.fill(E);}
if(i%2==0)
{ g2.setColor(Color.yellow);
g2.fill(E);}
if(i%2==1)
{ g2.setColor(Color.red);
g2.fill(R);
}
a+=14;s+=14;d-=30;f-=30;
}}
}
Output is
java program that print circles in circles
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=16,s=30,d=400,f=400;
for(int i=0;i<14;i++)
{
Ellipse2D.Double R= new Ellipse2D.Double(a,s,d,f);
g2.draw(R);
if(i%2==0)
{ g2.setColor(Color.BLACK);
g2.fill(R);
}
else
{ g2.setColor(Color.red);
g2.fill(R);
}
a+=14;s+=14;d-=30;f-=30;
}}
}
Output is
java graphical programs
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=16,s=30,d=400,f=400;
for(int i=0;i<14;i++)
{
Rectangle R= new Rectangle(a,s,d,f);
g2.draw(R);
if(i%2==0)
{ g2.setColor(Color.BLACK);
g2.fill(R);
}
else
{ g2.setColor(Color.green);
g2.fill(R);
}
a+=14;s+=14;d-=30;f-=30;
}}
}
Output is
java program that print olympic rings
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
Ellipse2D.Double R= new Ellipse2D.Double(128,20,110,110);
g2.draw(R);
g2.setColor(Color.black);
g2.fill(R);
Ellipse2D.Double R2= new Ellipse2D.Double(138,30,90,90);
g2.draw(R2);
g2.setColor(Color.white);
g2.fill(R2);
Ellipse2D.Double R3= new Ellipse2D.Double(12,20,110,110);
g2.draw(R3);
g2.setColor(Color.BLUE);
g2.fill(R3);
Ellipse2D.Double R4= new Ellipse2D.Double(22,30,90,90);
g2.draw(R4);
g2.setColor(Color.white);
g2.fill(R4);
Ellipse2D.Double R7= new Ellipse2D.Double(244,20,110,110);
g2.draw(R7);
g2.setColor(Color.red);
g2.fill(R7);
Ellipse2D.Double R8= new Ellipse2D.Double(254,30,90,90);
g2.draw(R8);
g2.setColor(Color.white);
g2.fill(R8);
Ellipse2D.Double R9= new Ellipse2D.Double(194,95,110,110);
g2.draw(R9);
g2.setColor(Color.green);
g2.fill(R9);
Ellipse2D.Double R10= new Ellipse2D.Double(204,105,90,90);
g2.draw(R10);
g2.setColor(Color.white);
g2.fill(R10);
Ellipse2D.Double R11= new Ellipse2D.Double(65,95,110,110);
g2.draw(R11);
g2.setColor(Color.yellow);
g2.fill(R11);
Ellipse2D.Double R12= new Ellipse2D.Double(75,105,90,90);
g2.draw(R12);
g2.setColor(Color.white);
g2.fill(R12);
}
}
Output is
java top 10 programs that print beautiful images
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=1,s=1,d=12,f=1,l=1,h=1,j=1,k=1;
for(int z=0;z<100;z++) {
Ellipse2D.Double R11= new Ellipse2D.Double(a,s,d,f);
g2.draw(R11);
g2.setColor(Color.yellow);
g2.fill(R11);
Ellipse2D.Double R12= new Ellipse2D.Double(h,j,k,l);
g2.draw(R12);
g2.setColor(Color.white);
g2.fill(R12);
a+=3;s+=3;d+=3;f+=3;h+=1;j+=1;k+=1;l+=1;
}
a=200;s=200;d=200;f=200;l=200;h=200;j=200;k=200;
for(int z=0;z<100;z++) {
Ellipse2D.Double R11= new Ellipse2D.Double(a,s,d,f);
g2.draw(R11);
g2.setColor(Color.MAGENTA);
g2.fill(R11);
Ellipse2D.Double R12= new Ellipse2D.Double(h,j,k,l);
g2.draw(R12);
g2.setColor(Color.white);
g2.fill(R12);
a+=3;s-=3;d-=3;f-=3;h-=1;j-=1;k-=1;l-=1;
}}
}
Output is
java beautiful rings program
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void
paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
Ellipse2D.Double R= new Ellipse2D.Double(128,20,110,110);
g2.draw(R);
g2.setColor(Color.blue);
g2.fill(R);
Ellipse2D.Double R2=
new Ellipse2D.Double(138,30,90,90);
g2.draw(R2);
g2.setColor(Color.white);
g2.fill(R2);
Ellipse2D.Double R3= new Ellipse2D.Double(12,20,110,110);
g2.draw(R3);
g2.setColor(Color.green);
g2.fill(R3);
Ellipse2D.Double R4=
new Ellipse2D.Double(22,30,90,90);
g2.draw(R4);
g2.setColor(Color.white);
g2.fill(R4);
Ellipse2D.Double R7= new Ellipse2D.Double(244,20,110,110);
g2.draw(R7);
g2.setColor(Color.red);
g2.fill(R7);
Ellipse2D.Double R8=
new Ellipse2D.Double(254,30,90,90);
g2.draw(R8);
g2.setColor(Color.white);
g2.fill(R8);
Ellipse2D.Double R9= new Ellipse2D.Double(244,121,110,110);
g2.draw(R9);
g2.setColor(Color.red);
g2.fill(R9);
Ellipse2D.Double R10=
new Ellipse2D.Double(254,131,90,90);
g2.draw(R10);
g2.setColor(Color.white);
g2.fill(R10);
Ellipse2D.Double R11= new Ellipse2D.Double(12,121,110,110);
g2.draw(R11);
g2.setColor(Color.green);
g2.fill(R11);
Ellipse2D.Double R12=
new Ellipse2D.Double(22,131,90,90);
g2.draw(R12);
g2.setColor(Color.white);
g2.fill(R12);
Ellipse2D.Double R18= new Ellipse2D.Double(128,121,110,110);
g2.draw(R18);
g2.setColor(Color.blue);
g2.fill(R18);
Ellipse2D.Double R19=
new Ellipse2D.Double(138,131,90,90);
g2.draw(R19);
g2.setColor(Color.white);
g2.fill(R19);
}
}
Output is
java very beautiful drawing
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(700,700);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a class of paints and call it in main class
package graphs;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
int a=1,s=1,d=1,f=1,l=1,h=1,j=1,k=1;
for(int z=0;z<100;z++) {
Ellipse2D.Double R11= new Ellipse2D.Double(a,s,d,f);
g2.draw(R11);
g2.setColor(Color.yellow);
g2.fill(R11);
Ellipse2D.Double R12= new Ellipse2D.Double(h,j,k,l);
g2.draw(R12);
g2.setColor(Color.white);
g2.fill(R12);
a+=3;s+=3;d+=3;f+=3;h+=1;j+=1;k+=1;l+=1;
}
a=200;s=200;d=200;f=200;l=200;h=200;j=200;k=200;
for(int z=0;z<100;z++) {
Ellipse2D.Double R11= new Ellipse2D.Double(a,s,d,f);
g2.draw(R11);
g2.setColor(Color.MAGENTA);
g2.fill(R11);
Ellipse2D.Double R12= new Ellipse2D.Double(h,j,k,l);
g2.draw(R12);
g2.setColor(Color.white);
g2.fill(R12);
a+=3;s+=3;d-=3;f-=3;h-=1;j-=1;k-=1;l-=1;
}}
}
Output is
Tuesday, 14 November 2017
jav program circles in rectangles
This is main class
package graphs;
import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(300,390);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a new class of paints
package graphs;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
g2.drawString("An intelligent face", 10, 10);
int i=1,j=1,k=1,l=1;
for(int h=0;h<20;h++){
Rectangle R= new Rectangle(i,j,k,l);
g2.draw(R);
Ellipse2D.Double E=new Ellipse2D.Double(i,j,k,l);
g2.draw(E);
i+=11;j+=9;k+=11;l+=9;
}
}
}
////////////////////
Output is
java 3d program A lot of rectangles in circles
This is main class
package graphs;import javax.swing.*;
public class Graphs {
public static void main(String[] args) {
String title="ALLAH IS ONE";
JFrame f= new JFrame();
f.setSize(300,390);
f.setTitle(title);
paints P= new paints();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
After writing main class create a new class of paints
package graphs;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class paints extends JComponent {
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
g2.drawString("An intelligent face", 10, 10);
int i=1,j=1,k=1,l=1,q=1,w=1,e=1,r=1;
for(int h=0;h<20;h++){
Rectangle R= new Rectangle(i,j,k,l);
g2.draw(R);
Ellipse2D.Double E=new Ellipse2D.Double(q,w,e,r);
g2.draw(E);
q+=1;w+=2;e+=10;r+=9;
i+=3;j+=4;k+=5;l+=5;
}
}
}
Output:
java top ten 3D programs
This is main class
package test;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.ColorModel;
import javax.swing.JFrame;
class Test
{
public static void
main(String args[])
{ String title="ALLAH IS ONE";
for(int
i=0;i<3;i++){
JFrame f= new
JFrame();
f.setSize(200,300);
if(i==2)
f.setTitle(title);
paint P= new
paint();
f.add(P);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}}
After the main class create a new class of
paint and call it in main class
import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
public class paint extends JComponent {
public void
paint(Graphics g)
{
Graphics2D g2
= (Graphics2D) g;
g2.drawString("An intelligent face", 10, 10);
int
i=1,j=1,k=1,l=1;
for(int h=0;h<170;h++){
Rectangle R= new
Rectangle(i,j,k,l);
g2.draw(R);
i+=1;j+=1;k++;l++;
}
}}
Output is
Subscribe to:
Posts (Atom)