Electrofriends

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

by Ranjith | April 4th, 2010.

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 [...]

Read More..

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

by Ranjith | April 4th, 2010.

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 [...]

Read More..

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

by Ranjith | October 4th, 2009.
Java applet progrme for draw lines, circle, rectangle

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);

Read More..

Java applet program for handling Keyboard events

by Ranjith | October 4th, 2009.
Java Keyboard programe output

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

Read More..

Java applet program for handling mouse events

by Ranjith | October 4th, 2009.
Java mouse handling events

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

Read More..

Java applet program for calculator

by Ranjith | October 4th, 2009.

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.

Read More..

Java applet program for interest rate calculation

by Ranjith | October 4th, 2009.
Java applet program output for interest rate calculation

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.

Read More..

Java applet program that displays a simple message

by Ranjith | October 4th, 2009.
Java Applet program output

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

Read More..

Share and enjoy

    • Digg
    • Facebook
    • Technorati
    • StumbleUpon
    • Twitter
    • Reddit
    • del.icio.us
    • Yahoo! Buzz
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya