The Artima Developer Community
Sponsored Link

Java Answers Forum
simple beginners question for exam

1 reply on 1 page. Most recent reply: Nov 29, 2005 3:14 AM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
tommy canton

Posts: 1
Nickname: tommy2too
Registered: Nov, 2005

simple beginners question for exam Posted: Nov 29, 2005 3:00 AM
Reply to this message Reply
Advertisement
Extend the Shape application you have already developed to include the following:
a. Add buttons (and associated logic) to Draw, Store and Load shapes. Store and Load should allow the user to specify a file name.
b. Associate a random color with each shape and display it in its outline form (if not already coded)
c. Add the facility to specify how many shapes to draw (this should replace the original command line option).
d. Create a border around the shape drawing region i.e. so no shape touches the edge of the frame

Hints we got-
Action listeners will be needed for the buttons
Review the JFileChooser class.
Consider developing storeDrawing and loadDrawing methods
ObjectOutputStream and ObjectInputStream might be useful classes to explore however classes must implement the serializable interface. When reading an object from a file it will have to be cast to an appropriate type.
Use the repaint method when you want to display a new drawing
Some of the classes you use might throw exceptions and in some cases you may have to catch them in order to compile your program.

Sorry if this is too easy but its just to get me started.


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: simple beginners question for exam Posted: Nov 29, 2005 3:14 AM
Reply to this message Reply
"Extend the Shape application you have already developed"
Are you kidding?`

We didn't develope anything.

Post a question if you have problems and we'll be glad to help, but do not expect us to do your work.

Flat View: This topic has 1 reply on 1 page
Topic: JPG Previous Topic   Next Topic Topic: GeneratingClasses and mappingFiles from database schema/ sql with ant/maven

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use