Solved

need help w/ JFrame and class Graphics2d

Posted on 2006-10-25
1
314 Views
Last Modified: 2008-03-03
I need some help with this assignment, this is a beggining java course im taking online, I just need help setting up the classes, since this is homeowrk you can point me to a good tutorial, or just psuedo code to get me started thanks for the help !


Write a JFrame application that simulates a screen saver. The application should displays randomly generated triangles, draws characters, and draw lines. After drawing 100 of them, the application should clear itself and start drawing lines again. To allow the program to draw continuously, place a call to repaint as the last line in method paint.

Each triangle should be filled with a different color. Use class GeneralPath and method fill of class Graphics2D to draw the triangles in different colors and different sizes.

The characters will be generated are A to Z , 26 characters, and 0 to 9, 10 number-digits. The characters will be draw in different font sizes and colors.

The drawing lines will use method drawLine of class Graphics to generate different lengths and colors.
0
Comment
Question by:dreaminbinary
1 Comment
 
LVL 14

Accepted Solution

by:
hoomanv earned 310 total points
ID: 17805215
Start learning the Java 2D API
http://java.sun.com/docs/books/tutorial/2d/index.html

A nice open-source demo of java 2d can be found in your jdk installation directory
jdk_home\demo\jfc\Java2D
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now