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 [...]
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 [...]
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);
Sunday, October 4th, 2009 »
Posted By Ranjith » Total 6 Comments
public void init()
{
addKeyListener(this);
requestFocus();
setBackground(Color.green);
setForeground(Color.blue);
}
Sunday, October 4th, 2009 »
Posted By Ranjith » Total 4 Comments
addMouseListener(this);
addMouseMotionListener(this);
setBackground(Color.black);
setForeground(Color.red);
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.
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.
Sunday, October 4th, 2009 »
Posted By Ranjith » Total 1 Comment
public void init()
{
msg+=”init()—>”;
setBackground(Color.orange);
}
This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.
#Home #Sitemap #Submit #Terms of Use
Copyright©2011 electrofriends.com All Rights Reserved
Contact:info@electrofriends.com | Powered by Dhyeya