Electrofriends

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

by Ranjith | October 4th, 2009.
Java applet program that allows the user to draw lines, rectangles and ovals

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 applet program for handling Keyboard events

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 applet program for handling mouse 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 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 that displays a simple message

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

Read More..
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya