Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners its the coding of create layout of chess in applet
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


tejas
its the coding of create layout of chess in applet
0 Answer(s)      2 years and 6 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;
    }

     }
}

Advertisement
View Answers

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
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
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
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
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
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
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
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
Border Layout
Border Layout  which containers use a border Layout as their default layout
layout manager
layout manager  how to use Absolute Layout manager in java form
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
Layout Manager
Layout Manager  for compile file "Javac SApplet.java" (working fine...*; public class SApplet extends Applet implements ActionListener...); b1.addActionListener(this); lbl = new JLabel("This is the Swing Applet Example
Tile layout container
Tile layout container       Tile layout container arranges its children in square grid depending... create number of rows using GridRow tag and each cell occupies space according
java layout
java layout  What is a layout manager
Applet
Applet  Write an applet to display a string in an applet. String should be passed as a parameter to an applet
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
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
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
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  how to run an applet on a web browser
Applet
Applet  Give the class hierarchy of an Applet class
applet
applet  What is the immediate superclass of the Applet class
tables for layout
tables for layout  Are there any problems with using tables for layout
java layout
java layout  What method is used to specify a container?s layout
tables for layout
tables for layout  Are there any problems with using tables for layout
Applet
Applet  Write a ava applet that sets blue color foreground and yellow color background at the start of an applet
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
Advertisements
 

 

 

DMCA.com