Member Avatar

Hi everyone, i need your help.. I want to draw a circle,square and rectangle on Jframe on a click of a button.. This program was asked in my test paper, i couldn't get it right though bt i wanna know what my mistake is.. Plz help me.. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class CRS extends JFrame implements ActionListener { JButton b1,b2,b3; Graphics g; Container con; public CRS() { super("Draw Circle in JFrame"); con=getContentPane(); con.setLayout(new FlowLayout()); b1=new JButton("Circle"); b2=new JButton("Rectangle"); b3=new JButton("Square"); con.add(b1); con.add(b2); con.add(b3); b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); } public void Circle() { g.drawOval(50,50,100,100); } public void Rectangle() { …

Member Avatar
0
14
Member Avatar

how to add circle marker on google map by giving latitude,longitude and radius in KM?

Member Avatar
0
3
Member Avatar

im' confuse with this function...how do i call one function so it can be used in another function?? [ICODE]#include <iostream> #include <cmath> using namespace std; double pi=3.1416; double getinput(); double distance(double,double,double,double); double radian(double); double circumferences(double); double area(double); double diameter(double); void displayresult(double,double,double,double); int main() { double x1,x2,y1,y2; double rad,perimeter,areas,dia; cout<<"Please enter center point of a circle :"; cin>>x1>>y1; cout<<"Please enter a point on a circle :"; cin>>x2>>y2; rad=radian(rad); perimeter=circumferences(perimeter); areas=area(areas); displayresult(rad,perimeter,areas,dia); system("pause"); return 0; } /*double getinput() { double x1,x2,y1,y2; cout<<"Please enter center point of a circle "; cin>>x1>>y1; cout<<"Please enter a point on a circle "; cin>>x2>>y2; }*/ double distance(double …

Member Avatar
0
7

The End.