1 / 2

Java Applet for Background and Font Color Customization

This Java applet demonstrates how to change background and font colors using the AWT library. It sets the background color to black and illustrates the usage of graphics methods to draw shapes like lines, ovals, and rectangles. Additionally, it highlights the importance of handling exceptions, such as ArithmeticExceptions when attempting to perform division by zero. This applet serves as a practical example for understanding basic Java graphics and event handling in applets.

ivan
Télécharger la présentation

Java Applet for Background and Font Color Customization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Wap change backgrond color import java.awt.*; import java.applet.*; public class App2 extends Applet { public void paint(Graphics g) { g.setBackground(Color.black); }} Wap change font and color import java.awt.*; import java.applet.*; public class App2 extends Applet { public void paint(Graphics g) { g.setBackground(Color.black); g.setForeground(Color.black); }} القسمة على صفر الاوت بوت java.lang.ArithmeticsxceptionL:/ by zero

  2. import java.awt.*; import java.applet.*; public class app extends Applet { public void paint(Graphics g) { g.drawLine(100,100,100,100); رسم خط g.drawOval(50,50,100,100); رسم دائرة g.drawRect (50,50,100,100); مربع } } /*<applet code=app width=500 height=500></applet>*/

More Related