Output to an applet’s window - Java

Is it possible for a method other than paint() or update() to output to an applet’s window? Explain how

Yes it is possible for a method other than paint() or update() to output an applet’s window. It is mandatory to obtain a graphics context by invoking getGraphics() method, that is defined Component class. Later use it to output to the window.

Create an instance of the class BufferedImage. Use the method getGraphics(), which returns the Graphics object.
The methods drawOval(), setColor() can be used as
graphics.drawOval(150,150,120,50);
graphics.setColor(Color.green);
What is byte code? - Java
The compiled Java source code is known as byte code. Java compiler generates the byte code...
Range and behavior of its primitive types - Java
Java strictly specifies the ranges for primitive values. The selection of values in integer or floating point types differs based on the requirement of an application...
What is Java’s character type?
The char data type in Java is a single 16-bit Unicode character. It represents a character that could be any one of the world languages...
Post your comment