Java program to implement a shape selector from a given set of shapes

Sunday, April 4th, 2010  »  Posted By Ranjith  »  Total 2 Comments

To implement a shape selector from a given set of shapes import java.awt.*; import java.awt.event.*; import java.applet.*;   public class shape extend Applet implements itemListener { Chekbox reet,circle,line; ChekboxGroup cbg;   String msg; String s1="reet"; String s2="circle"; string s3="line"; publice void init() { cbg=new checkboxGroup();   rect = new checkbox("reet,cbg,tru); circle = new Checkbox("circle",cbg.false); line [...]

Java program to implement a Color Section from a given set of Color.

Sunday, April 4th, 2010  »  Posted By Ranjith  »  Total 3 Comments

To implement a Color Section from a given set of Color. import java.awt*; import java.awt.event.*; import java.applet.*;   public class fillcolor extends Applet implement Item Listener { checkbox red,yellow,black,blue.orange; CheckboxGroup cbg; String msg; String s1="red"; String s2="yellow"; String s3="black"; String s4="orange"; public void init() { cbg = new CheckboxGroup(); red = new Chechbox("red",cbg,true); yellow= new [...]

Java applet program that allows the user to draw lines, rectangles and ovals

Java applet progrme for draw lines, circle, rectangle Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 6 Comments

Color c1=new Color(35-i,55-i,110-i);
g.setColor(c1);
g.drawRect(250+i,250+i,100+i,100+i);
g.drawOval(100+i,100+i,50+i,50+i);
g.drawLine(50+i,20+i,10+i,10+i);

Java applet program for handling Keyboard events

Java Keyboard programe output Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 6 Comments

public void init()
{
addKeyListener(this);
requestFocus();
setBackground(Color.green);
setForeground(Color.blue);
}

Java applet program for handling mouse events

Java mouse handling events Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 4 Comments

addMouseListener(this);
addMouseMotionListener(this);
setBackground(Color.black);
setForeground(Color.red);

Java applet program for calculator

Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 8 Comments

Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons for the digits and for the + – * % operations.Add a text field to display the result.

Java applet program for interest rate calculation

Java applet program output for interest rate calculation Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 0 Comment

Write a Java program that computes the payment of a loan based on the amount of the loan, the interest rate and the number of months. It takes one parameter from the browser: Monthly rate;if true, the interest rate is per month; Otherwise the interest rate is annual.

Java applet program that displays a simple message

Java Applet program output Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 1 Comment

public void init()
{
msg+=”init()—>”;
setBackground(Color.orange);
}

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup