Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


sassy
square
3 Answer(s)      6 years and a month ago
Posted in : Java Beginners



Advertisement
View Answers

August 18, 2008 at 4:37 PM


Hi friend,


Code to display the shape of "square"


import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;

public class SquareShape extends Frame {

Shape square = new Rectangle2D.Double(100, 100,100, 100);
public void paint(Graphics g) {
Graphics2D ga2D= (Graphics2D)g;


ga2D.setPaint(Color.blue);
ga2D.draw(square);
}

public static void main(String args[]) {
Frame sqFrame = new Square();
sqFrame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
System.exit(0);
}
});
sqFrame.setSize(300, 250);
sqFrame.setVisible(true);
}
}

For read more information :

http://www.roseindia.net/java/example/java/awt/


Thanks


September 13, 2011 at 2:21 PM


hi friend



September 13, 2011 at 2:21 PM


square the cube in java?



Related Tutorials/Questions & Answers:
Square Root
Square Root  Hi, can any one please tell me the code to findout the square root of a given number with using built in function??? Thanks a lot in advance!! Regards: Akash
print square of any number
print square of any number  using c++ language, write aprogram to print the square of any number entered by the user
Advertisements
square - Java Beginners
square  what is the java code to display the shape of "square"?  Hi friend, Code to display the shape of "square" import... SquareShape extends Frame { Shape square = new Rectangle2D.Double(100, 100,100
printing hollow square
printing hollow square  Write an application (PrintingSquares.java) that prompts the user to enter the size of the side of a square, then displays a hollow square of that size made of asterisks. Your program should work
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Square pattern in java using for loop
Square pattern in java using for loop  please explain the logic to program the following using for loop in Java: 1 3 5 7 9 3 5 7 9 1 5 7 8 1 3 7 9 1 3 5 9 1 3 5 7
Robust Magic Square Tester - Java Beginners
Robust Magic Square Tester  I need a program to determine if a file of numbers is a magic-square. a magic square of order n is an arrangement of nē numbers in a square, such that the n numbers in all rows, all columns, and both
Using JSTL For Finding Square
Using JSTL For Finding Square   ... are going to find out the square of values from 1 to 10. But the approach we are taking to finding out the square is the JSTL.  We are using the <c
accepts the area of a square and will calculate its perimeter.
accepts the area of a square and will calculate its perimeter.  Develop a program that accepts the area of a square and will calculate its perimeter... input=new Scanner(System.in); System.out.println("Enter Area of Square
how to find square and cube of five number
how to find square and cube of five number  how to find square and cube of five number   Hi Friend, Try the following code: <html> <script> document.writeln("Square of 5 numbers:<br><br>
Label.setText showing square boxes for non english locales
Label.setText showing square boxes for non english locales  Hi, I am using Label.setText to display a value in applets of the application by fetching... are getting displayed as square boxes when locale is passed other than english locale
Java : Square root of any number
Java : Square root of any number In this section we will write code for finding square root of any number without using system methods. Square root : It is number when we square it, find the specified number. There is simplest way
Square Elements of Two Dimensional Array
Square Elements of Two Dimensional Array   ... the two dimensional array program and its square. This session provide you...: We are going to display the square of two matrix. Firstly, we have to define
Calculating square root using JSP & jQuery
Calculating square root using JSP & jQuery In this tutorial, we will find square root of any number with the help of JSP & jQuery. In this example, we have a JSP file which have jQuery 'javascript' : index.jsp <
Java Square Root And Cube Root Example
Java Square Root And Cube Root Example In this section we will discuss about how to find the square root and cube root of a number. This example explains you about finding the square root and cube root of a number. This tutorial
Q6 Write a java applet that displays 9 squares, one below the other. Every third square must be filled in black?
Q6 Write a java applet that displays 9 squares, one below the other. Every third square must be filled in black?  Q6 Write a java applet that displays 9 squares, one below the other. Every third square must be filled in black
Security in Web Service
the web service class name as square Type the package name ...  */ @WebService() public class square {   ...) {   return "area of square of side"+side+" 
Tile layout container
Tile layout container       Tile layout container arranges its children in square grid depending... below puts 7 child input boxes in tile container. Tile arranges them in square
JPA Sqrt Function
. This method returns the square root of the given argument. JPA sqrtFunction... the square root of price is grater than 25. For JPA sqrt application, you need
C Array Declaration
of elements inside the square brackets. Syntax for creating an array   data
Running the Test Plan
. To indicate that the test is running a green square lits up in the upper-right... active threads is indicated by the numbers to the left of the green square. The green square will change to grey Once JMeter  finishes running your
program
program  accepts the area of a square and will calculate its perimeter.   Hello Friend, Visit Here Thanks
java code
java code  Write a program to find the difference between sum of the squares and the square of the sums of n numbers
java code
java code   Develop a program that accepts the area of a square and will calculate its perimeter
count asterisk in a grid - Java Beginners
count asterisk in a grid  I need to write a program that uses a recursive method to count the number of asterisk in a square grid
program
program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers
java program
java program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers
macros
for this: include include define SQUARE(x) x*x int main() { int i = 2; int j= SQUARE(i); printf("The value of j is: %d\n", j); getch(); return 0... that represent statements or expressions. The code define a macro i.e SQUARE(x) x*x
Advertisements
 

 

 

DMCA.com