JavaDeploy
SiteMap
Readers Writers
Java Streams
Java Programming
Java Language
Java Graphics
«Prev
Java Language
Packages Interfaces
Java Classes - Quiz
Java Graphics
Java Graphics - Quiz
Java Graphics Conclusion
122
MultiThreaded Programming
Multithreaded Programming Basics
Thread Significance Assessment
Create Use Thread Class
Implement Runnable Interface
Sleeping Threads
Thread Synchronization
wait notify Methods
Multithreaded Programming - Conclusion
Set Daemon Threads
Multithreaded Programming - Quiz
Multithreading Fundamentals - Quiz
Handling Exceptions
Understanding Exceptions
Throwing Exception
Catching Exceptions
Catching Exceptions
Custom Exceptions
finally Clause
Handling Exceptions Conclusion
Java Input Output
Create Reader Streams
122
Drawing text Exercise
Objective:
Use the AWT Graphics class to draw text.
Instructions
Use the AWT Graphics class to create an applet named DisplayOS that draws the operating system name and version in a bold, 20-point Monospaced font. To obtain the operating system name and version as strings, use the System.getProperty() method and pass in "os.name" and "os.version".
Following is an example:
String osName = System.getProperty("os.name");
Source files
A prepared HTML file in the download file available from the Sitemap page has been supplied.
The specific HTML file for this exercise can be found in the 03-04 folder.
Exercise scoring
The full credit for this exercise is 10 points. To receive full credit, you will need to successfully create the source code for the applet.
Submit the code
In the text box below, cut and paste the source code for the DisplayOS applet. Click,
Submit
to submit your answer.
Submit