Home Answers Viewqa Java-Beginners examples to draw Square in applet

 
 


Rajan Thapa
examples to draw Square in applet
0 Answer(s)      2 years and 2 months ago
Posted in : Java Beginners

  1. Write a Java Program with file name SectionB.java using Switch control Statement

The program will use the JOptionPane and ask the user to enter any number between 1 to 12.

Based on the input, then the program will show how many days in that month. For example if the user enters 1, the program will show â??The Month you entered is January and it has 31 daysâ??. The output will be shown in the JOptionpane.

  1. Now modify the program; if the user enters â??2â?? the program will ask the user if it is a leap year. If the answer from the user is â??Yesâ?? it will show the message â??February has 29 daysâ??, if the response from the user is â??Noâ?? it will show â??February has 28 daysâ??. Again, the output should be shown in JOptionPane.

NOTE:

[In this program use try and catch block to handle any unacceptable and invalid input from the user]

View Answers









Related Pages:
how to draw network(lines and nodes) in java - Applet
how to draw network(lines and nodes) in java  Hi, Iam doing my MSC project. I want to know, how can we draw a network(with lines and nodes, any number of lines and nodes... say 5). I also want to know how can we draw a graph
how can i draw a table using applet or swings - Java Beginners
how can i draw a table using applet or swings  Hi RoseIndia, Actually, I was trying for creating a table using applet or swings.......... My task... to enter integer values..........but the examples i have gone through are accepting
Applet
Applet  Draw the class hierarchy of an Applet class. Also explain how to set background and forground colors in java
Write a Java applet to draw cylinder and pentagon shapes.
Write a Java applet to draw cylinder and pentagon shapes.  Write a Java applet to draw cylinder and pentagon shapes
java - Applet
java  1.An applet program to draw a line graph for y=2x+5.[for suitable values of x & y] 2. An applet program to draw following shapes (1)cone, (2)cube, (3)square inside a circle  Hi friend, this is cubic code
java.applet package examples
java.applet package examples - Applet Tutorials       What is Applet This section introduces you with the applet and describes the advantages
applet - Applet
applet   how to draw textboxes using applets  Hi Friend...*; import java.awt.*; public class CreateTextBox extends Applet implements.../applet/ Thanks
how to drag top most images which is draw on applet.
how to drag top most images which is draw on applet.  Please help me, I have draw 83 images one by one from g.drawImages(,,,,); now I want to drag last image from 83 images and drop it suitable place, Now please help me , how can
applet program code - Applet
applet program code  hello sir, i did't get the code for below problem... please help me... 1.An applet program to draw a line graph for y=2x+5.[for suitable values of x & y
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
drawing shapes in applet - Applet
drawing shapes in applet  hi, i need a single applet prgm which draws cone,cube and square in circle.  Hi manju, This is cube example... java.applet.Applet; public class CubeExample extends Applet { Stroke
methods in the applet - Applet
; public class applet1 extends Applet { String m; public void init... applet is simular to the contructor defined in a java application. The purpose... of the paint() method is to draw itself. There are two ways in which this paint
about graph - Applet
about graph  How to draw a graph in applet and that should be display in web browser? How to make a running applet in our browser? for example ticker
Java Code - Applet
Java Code  How to Draw various charts(Pie,Bar,and Line etc.)using Applet
applet images sleeping programme - Applet
applet images sleeping programme  Dear Sir,         I shall be much tankful to you, if u can kindly give me the programe for    In a Applet how... java.applet.Applet; import java.util.Random; public class AppletSleep extends Applet
core java - Applet
core java  how can draw rectangle in applet. when i pressed in mouse button the rectangle's size will also increase
Draw An Arc in Graphics
Draw An Arc in Graphics       In this section, you will learn how to draw an arc in Graphics. An arc of a circle is a segment of the circumference of the circle. To draw an arc
Simple java applet
Simple java applet  Create a Java applet to display your address on the screen. Use different colors for background and text   Please visit the following link: Applet Examples
Draw a Triangle using a Line2D
Draw a Triangle using a Line2D       This section illustrates you how to draw a triangle using a Line2D. To draw a triangle, we are using Line2D class of package java.awt.geom.
Draw Ellipse in Rectangle
Draw Ellipse in Rectangle       This section illustrates you how to draw ellipse inside the rectangle. To draw an Ellipse inside the rectangle, we have defined two classes
HTML5 examples.
HTML5 quick examples. HTML5 Examples, Definition of <!DOCTYPE >..., Definition of acronym <acronym> tag in HTML5. HTML tags, Definition of applet.... HTML5 input examples, Introduction and implementation of input tag. HTML5
Arrays -- Examples
Java NotesArrays -- Examples This applet shows a number of methods that use arrays. The source code for the methods is also given below. This applet... There are many kinds of sort programs. These are examples showing some
Draw Rectangle in J2ME
Draw Rectangle in J2ME       In this series of J2ME examples and tutorials, we have introduced you with it's various features with examples. Now in the given example, you will learn
About Examples
Java NotesAbout Examples This series of progressive examples shows.... This is the real beginning of the pattern that will be used in many examples..., the applet idea for distributed software is probably better done with Java WebStart
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
core java - Applet
core java  how can draw a single line with mouse in applet. please help me   Hi Friend, Create an applet 'SimpleDrawApplet.java... applet will get start. Then you can draw the line with mouse on it. Thanks
core java - Applet
core java   Namaste sir , how can draw a line in Applet. I want when...(MouseEvent evt) { } } Then call this applet with html file 'applet.html'. Draw... -------------------------------------------------- and draw Plz help me. 
Applet
Applet  Write an applet to display a string in an applet. String should be passed as a parameter to an applet
examples
examples  Hi sir...... please send me the some of the examples... questions .   Hello Friend, Which type of connectivity examples do you want?Please clarify this. Thanks   mysql connectivity examples  
JPA Examples
JPA Examples In this section we will discuss about the examples of JPA. This section will describe you the various examples that will help you create JPA applications. In this page you will find various examples like methods of JPA
rob
examples Square in applet   Write a java applet (File Name is SectionC.java) which will draw a series of shapes of increasing dimension as shown.... In the following examples the user has chosen Square and entered 10. So it drew
applet
applet  What is the immediate superclass of the Applet class
applet
applet  Explain different stages in the lifecycle of an applet with figure.   Stages of Applet: Life cycle of an Applet: init(): This method is called to initialized an applet start(): This method is called after
Applet
Applet  Give the class hierarchy of an Applet class
Applet
Applet  how to run an applet on a web browser
Applet
Applet  Write a ava applet that sets blue color foreground and yellow color background at the start of an applet
Applet
Applet  Explain the start() and stop() methods of applet life cycle.   Start and Start method of Applet Life Cycle Start () method: The start method of an applet is called after the initialization method init
Applet
Applet  Write a short note on applet life cycle
J2ME Draw String
J2ME Draw String       In the previous examples, we learned about drawing different graphics... class to draw the string. Given methods are used to set the actual layout
Applet - Java Beginners
{ // The rest of the applet will be in the next // example...(Graphics g) { int i; // Draw the points that have been
The <APPLET> Tag in Detail
lets explore the APPLET tag now. The format of this tag is given below: [<]APPLET attributes[>] applet_parameters alternate_content [</]APPLET[>]  <APPLET> Tag Attributes in detail.The three
Java Program - Applet
Java Program  How to Draw various types of Charts Like pie,Line,Bar... the following links: http://www.roseindia.net/java/example/java/swing/draw-simple-bar-chart.shtml http://www.roseindia.net/java/example/java/swing/draw-pie
applet
applet  what is applet in java   An applet is a small program that can be sent along with a Web page to a user. Java applets can perform... the following link: Applet Tutorials
Applet
Applet  Write a Java applet that drwas a line between 2 points. The co-ordinates of 2 points should be passed as parametrs from html file. The color of the line should be red
applet
applet  applet to open new tab not working.here's my code import java.applet.*; import java.awt.*; import java.net.*; import java.awt.event.*; public class NewURL extends Applet implements ActionListener{ public void init
Java 2D Graphics - Applet
of examples. Hope that it will be helpful for you. Thanks
rob
draw a series of shapes of increasing dimension  Write a java applet (File Name is SectionC.java) which will draw a series of shapes of increasing... squares or circles. In the following examples the user has chosen Square
rob
draw a series of shapes  Write a java applet (File Name is SectionC.java) which will draw a series of shapes of increasing dimension as shown.... In the following examples the user has chosen Square and entered 10. So it drew ten
rob
. In the following examples the user has chosen Square and entered 10. So it drew ten squares...Java applet   Write a java applet (File Name is SectionC.java) which will draw a series of shapes of increasing dimension as shown on the following

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.