![]() Similarly, we provide the coordinates and color for the second line. We alter the color of the first line using setColor() and then the x and y coordinates of the line in the drawLine() function. The drawString() function here displays some text on the output frame. We change the font using the setFont() function. The paint method here is used to set the color, font, and coordinates o the line to be drawn. We use the system.exit(0) command to exit the applet frame. The tSize() function is used to set the size of the applet window, and the tVisible(true) function is used to make the frame appear on the screen. Here the Frame drawLineApplet = new Frame() statement creates the applet window for the output. It also lets the opacity of the color to be. This dialog provides RGB, HSB and Web modes of interaction, to create new colors. If the user does not want to choose from the predefined set, they can create a custom color by interacting with a custom color dialog. It is quite easy to develop such a client-side application. ![]() Inside the class, we declared the main method. The ColorPicker control provides a color palette with a predefined set of colors. Create a Simple Color Picker using JavaScript. We first declared a DrawLine class, which extends the Applet class (Parent class). In the above example, we created two lines and also displayed some text. Le contrle ColorPicker permet l'utilisateur de slectionner une couleur dans une palette de couleurs standard avec une simple slection. Import import java.awt.* import .* public class DrawLine extends Applet
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |