its the coding of create layout of chess in applet

Ads

 
 

Share on Google+Share on Google+

tejas
its the coding of create layout of chess in applet
0 Answer(s)      5 years and 4 months ago
Posted in : Java Beginners
/* <Applet code="MyApplet8" width="480" height="480">
    </Applet>
*/

import java.applet.*;
import java.awt.*;

public class MyApplet8 extends Applet
{

    public void paint(Graphics g)
    {
        int w=getWidth();
        int h=getHeight();
        int y=0;
        for(int j=1;j<=4;j++)
        {


        for(int i=0;i<=w;i=i+w/8)
        {



            g.setColor(Color.BLACK);
            g.fillRect(i,y,w/8,h/8);
            i=i+w/8;
            g.setColor(Color.WHITE);
            g.fillRect(i,y,w/8,h/8);

        }
            y=y+h/8;
        for( int i=0;i<=w;i=i+w/8)
        {
            g.setColor(Color.WHITE);
            g.fillRect(i,y,w/8,h/8);
            i=i+w/8;
            g.setColor(Color.BLACK);
            g.fillRect(i,y,w/8,h/8);
        }
            y=y+h/8;
    }

     }
}
Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
hi its the coding of create layout of chess in applet i hope u like it
its the coding of create layout of chess in applet  /* <Applet code="MyApplet8" width="480" height="480"> </Applet> */ import java.applet.*; import java.awt.*; public class MyApplet8 extends Applet
Two user chess game - Applet
Two user chess game  Write a program for a two user chess game(Users must be on different systems)? please send me this source code to my mail id with step by step explanation
Advertisements
need help to create applet
... ~Create an Applet using all Layout Manager(use whatever component in each layout) a) FlowLayout b) BorderLayout c) GridLayout d) GridbagLayout...need help to create applet  Can u help me..?? I get a task ...and i
Need to create a java applet
Need to create a java applet   Hi people i need to create a java applet for which there will be 2 buttons to indicate small and big. I need to make a circle. When i click small the circle should be small and when i click big
How to create Applet Hello World?
How to create Applet Hello World?  Hi, What is Applet in Java? How to create Applet Hello World? Thanks   Hi, Applet is Java Program... to create applet class in Java and then compile it into class file. After
Create Layout Components in a Grid in Java
Create Layout Components in a Grid in Java       In this section, you will learn how to create layout components with the help of grid in Java Swing. The grid layout provides
Create SpreadSheet same as excel using java applet
Create SpreadSheet same as excel using java applet  Hi Ji, May i know to create new excel sheet using java Applet
Create SpreadSheet same as excel using java applet
Create SpreadSheet same as excel using java applet  Hi Ji, May i know to create new excel sheet using java Applet
how i want to create a coding by this question?
how i want to create a coding by this question?  Design and write a class named Person and its two subclasses named Student and Employee. Make Lecturer and Admin subclasses of Employee. A person has a name, address, phone number
Chess Application In Java Swing
; In this section, you will learn how to create chess game in java swing... .style1 { margin-right: 0px; } Chess Application... actions. This chess simulator will help you to master your chess playing
Chess Game
Chess Game  How could I make a basic 8x8 chess table with two dimensional arrays and insert the chess pieces in the array?   Please visit the following link: http://roseindia.net/java/example/java/swing/chess
Problem In applet Its run on browser but hang and blinking when image is draging some where.
Problem In applet Its run on browser but hang and blinking when image is draging some where.  I am Created applet in working properly on browser. In my applet 52 card images is draw and drage and move on the applet, but when I am
Applet
Applet  Write an applet to display a string in an applet. String should be passed as a parameter to an applet
coding
coding  I need the logout coding. can you please help me.   Please visit the following links: http://www.roseindia.net/quickguide/tomcat/Logout.shtml http://www.roseindia.net/jsp/loginstatus.shtml
applet
applet  What is the immediate superclass of the Applet class
Applet
Applet  how to run an applet on a web browser
applet
applet  Explain different stages in the lifecycle of an applet with figure.   Stages of Applet: Life cycle of an Applet: init(): This method is called to initialized an applet start(): This method is called after
Applet
Applet  Give the class hierarchy of an Applet class
applet - Applet
.  Hi Friend, Try the following code: 1)Create an applet... extends Applet{ public void paint(Graphics g){ g.drawString("Welcome in Java Applet.",40,20); } } 2) Call this applet with html code
Applet
Applet  Write a ava applet that sets blue color foreground and yellow color background at the start of an applet
program to create student report using java applet,read the input using text boxesand generate the grades..?
program to create student report using java applet,read the input using text boxesand generate the grades..?   sir plz give me java applet codes for above question
Creating an Applet
, first of all you should know about what is applet and then you should focus on how to create an Applet using all Layout Manager. Below links can brief you about all... an Applet using all Layout Manager, can anyone help me in this regard. I donā??t know
coding
coding  write a program to create a file using thread1 and read the file using thread2 and display in the console
coding
coding  write a program to create file using thread 1 and read the same file using thread2 and disply
Applet
Applet  Explain the start() and stop() methods of applet life cycle.   Start and Start method of Applet Life Cycle Start () method: The start method of an applet is called after the initialization method init
Applet
Applet  Write a short note on applet life cycle
Applet
Applet  I have a java applet that has a button. On clicking the button it should disappear and another applet should appear. How to write this code???? Also in login applet after successful login it should display admin applet
coding
coding  Create table - Emp containing empId String (20), empName String (50), DOB Date, deptId String(20). Primary key is empId. Foreign Key is deptId. Populate some records
Version of com.marcelotomazini>chess dependency
List of Version of com.marcelotomazini>chess dependency
Version of com.marcelotomazini>chess dependency
List of Version of com.marcelotomazini>chess dependency
coding
coding  Write a java program to Create table - Employee containing empId String (20), empName String (50), DOB Date, deptId String(20). Primary key is empId. Foreign Key is deptId. Populate some records