square

square

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
ModuleNotFoundError: No module named 'square'
ModuleNotFoundError: No module named 'square'  Hi, My Python... 'square' How to remove the ModuleNotFoundError: No module named 'square'... to install padas library. You can install square python with following command
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
Artifacts of com.ms-square
List of Artifacts of com.ms-square maven depenency
ModuleNotFoundError: No module named 'kubernetes-square'
ModuleNotFoundError: No module named 'kubernetes-square'  Hi, My... named 'kubernetes-square' How to remove the ModuleNotFoundError: No module named 'kubernetes-square' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'magic_square'
ModuleNotFoundError: No module named 'magic_square'  Hi, My Python... 'magic_square' How to remove the ModuleNotFoundError: No module named 'magic_square' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pylink-square'
ModuleNotFoundError: No module named 'pylink-square'  Hi, My... 'pylink-square' How to remove the ModuleNotFoundError: No module named 'pylink-square' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'snum_square'
ModuleNotFoundError: No module named 'snum_square'  Hi, My Python... 'snum_square' How to remove the ModuleNotFoundError: No module named 'snum_square' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'square-cli'
ModuleNotFoundError: No module named 'square-cli'  Hi, My Python... 'square-cli' How to remove the ModuleNotFoundError: No module named 'square-cli' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'square-python'
ModuleNotFoundError: No module named 'square-python'  Hi, My... 'square-python' How to remove the ModuleNotFoundError: No module named 'square-python' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'blockdiagcontrib-square'
ModuleNotFoundError: No module named 'blockdiagcontrib-square'  Hi...: No module named 'blockdiagcontrib-square' How to remove the ModuleNotFoundError: No module named 'blockdiagcontrib-square' error? Thanks   
ModuleNotFoundError: No module named 'cfn-square'
ModuleNotFoundError: No module named 'cfn-square'  Hi, My Python... 'cfn-square' How to remove the ModuleNotFoundError: No module named 'cfn-square' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'gym-square'
ModuleNotFoundError: No module named 'gym-square'  Hi, My Python... 'gym-square' How to remove the ModuleNotFoundError: No module named 'gym-square' error? Thanks   Hi, In your python environment you
Version of com.ms-square>debugoverlay dependency
Version of com.ms-square>expandableTextView dependency
Version of com.ms-square>etsyblur dependency
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
ModuleNotFoundError: No module named 'magic-square-dpp'
ModuleNotFoundError: No module named 'magic-square-dpp'  Hi, My... named 'magic-square-dpp' How to remove the ModuleNotFoundError: No module named 'magic-square-dpp' error? Thanks   Hi, In your
Version of com.ms-square>android-util dependency
Version of com.ms-square>debugoverlay-no-op dependency
Version of com.squareup>android-times-square dependency
List of Version of com.squareup>android-times-square dependency
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... Area of Square:"); double area=input.nextDouble(); double side
Version of com.ms-square>saucelabs-gradle-plugin dependency
Version of com.squareup>android-times-square-parent dependency
List of Version of com.squareup>android-times-square-parent dependency
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:ADS_TO_REPLACE_1 <html> <script> document.writeln("Square of 5 numbers:<br>

Ads