Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
need help... Posted by cabrera31086 on 4 Apr 2006 at 11:57 PM
need help again this is my take home final exam, i dont know where to start... help guys please...

a. write an applet that displays a city skyline, similar to the drawing shown in figure 7-13. Name the applet Skyline.Java

[URL=http://img123.imageshack.us/my.php?image=fig0fu.jpg]http://img123.imageshack.us/img123/6469/fig0fu.th.jpg[/img][/url]

http://img123.imageshack.us/img123/6469/fig0fu.jpg

b. Add a button to the skyline applet. when the user clicks the button, change the sky color from day to night.

c. Modify the applet created in exercise b so the sky changes from day to night or night to day with each successive button click.

d. Add a moon to the sky for the night view, and a sun for the day view.

--- appreciate the help guys thanks...


i need it guys in saturday, help me please... thanks...
Report
Re: need help... Posted by zibadian on 5 Apr 2006 at 12:07 AM
: need help again this is my take home final exam, i dont know where to start... help guys please...
:
: a. write an applet that displays a city skyline, similar to the drawing shown in figure 7-13. Name the applet Skyline.Java
:
: [URL=http://img123.imageshack.us/my.php?image=fig0fu.jpg]http://img123.imageshack.us/img123/6469/fig0fu.th.jpg[/img][/url]
:
: http://img123.imageshack.us/img123/6469/fig0fu.jpg
:
: b. Add a button to the skyline applet. when the user clicks the button, change the sky color from day to night.
:
: c. Modify the applet created in exercise b so the sky changes from day to night or night to day with each successive button click.
:
: d. Add a moon to the sky for the night view, and a sun for the day view.
:
: --- appreciate the help guys thanks...
:
:
: i need it guys in saturday, help me please... thanks...
:
A: Drawing the skyline can be done using 2 Graphics.fillPoly() calls, each with its own color: 1 for the sky and 1 for the buildings.

B: The button should change the color of the key poly to Color.BLUE.

C: If you store the color in a object-variable, then you can easily switch between the night and day color, by using an simple if-statement.

D: The most basic sun shape is a yellow circle, while the most basic moon shae is a paler yellow/gray circle. If you want to have a traditional non-full moon, you should also draw a night-colored circle partly over the moon circle. This will effectively mask the "invisible" part of the moon.
Report
Re: need help... Posted by cabrera31086 on 5 Apr 2006 at 12:33 AM
This message was edited by cabrera31086 at 2006-4-5 0:34:19

: : need help again this is my take home final exam, i dont know where to start... help guys please...
: :
: : a. write an applet that displays a city skyline, similar to the drawing shown in figure 7-13. Name the applet Skyline.Java
: :
: : [URL=http://img123.imageshack.us/my.php?image=fig0fu.jpg]http://img123.imageshack.us/img123/6469/fig0fu.th.jpg[/img][/url]
: :
: : http://img123.imageshack.us/img123/6469/fig0fu.jpg
: :
: : b. Add a button to the skyline applet. when the user clicks the button, change the sky color from day to night.
: :
: : c. Modify the applet created in exercise b so the sky changes from day to night or night to day with each successive button click.
: :
: : d. Add a moon to the sky for the night view, and a sun for the day view.
: :
: : --- appreciate the help guys thanks...
: :
: :
: : i need it guys in saturday, help me please... thanks...
: :
: A: Drawing the skyline can be done using 2 Graphics.fillPoly() calls, each with its own color: 1 for the sky and 1 for the buildings.
:
: B: The button should change the color of the key poly to Color.BLUE.
:
: C: If you store the color in a object-variable, then you can easily switch between the night and day color, by using an simple if-statement.
:
: D: The most basic sun shape is a yellow circle, while the most basic moon shae is a paler yellow/gray circle. If you want to have a traditional non-full moon, you should also draw a night-colored circle partly over the moon circle. This will effectively mask the "invisible" part of the moon.
:

help me more in the graphics part... i started doing this, here's what i got and i dont know whats next... continue this please, thnx...

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class Skyline extends Applet implements ActionListener
{
Button pressMe = new Button("Press Me");
int day;

public void init() {
add(pressMe);
pressMe.addActionListener(this);
day = 1;
}

public void actionPerformed(ActionEvent e)
{
if (day == 1)
day = 0;
else
day = 1;
repaint();
}




Report
Re: need help... Posted by zibadian on 5 Apr 2006 at 3:48 AM
: This message was edited by cabrera31086 at 2006-4-5 0:34:19

: : : need help again this is my take home final exam, i dont know where to start... help guys please...
: : :
: : : a. write an applet that displays a city skyline, similar to the drawing shown in figure 7-13. Name the applet Skyline.Java
: : :
: : : [URL=http://img123.imageshack.us/my.php?image=fig0fu.jpg]http://img123.imageshack.us/img123/6469/fig0fu.th.jpg[/img][/url]
: : :
: : : http://img123.imageshack.us/img123/6469/fig0fu.jpg
: : :
: : : b. Add a button to the skyline applet. when the user clicks the button, change the sky color from day to night.
: : :
: : : c. Modify the applet created in exercise b so the sky changes from day to night or night to day with each successive button click.
: : :
: : : d. Add a moon to the sky for the night view, and a sun for the day view.
: : :
: : : --- appreciate the help guys thanks...
: : :
: : :
: : : i need it guys in saturday, help me please... thanks...
: : :
: : A: Drawing the skyline can be done using 2 Graphics.fillPoly() calls, each with its own color: 1 for the sky and 1 for the buildings.
: :
: : B: The button should change the color of the key poly to Color.BLUE.
: :
: : C: If you store the color in a object-variable, then you can easily switch between the night and day color, by using an simple if-statement.
: :
: : D: The most basic sun shape is a yellow circle, while the most basic moon shae is a paler yellow/gray circle. If you want to have a traditional non-full moon, you should also draw a night-colored circle partly over the moon circle. This will effectively mask the "invisible" part of the moon.
: :
:
: help me more in the graphics part... i started doing this, here's what i got and i dont know whats next... continue this please, thnx...
:
: import java.applet.*;
: import java.awt.*;
: import java.awt.event.*;
:
: public class Skyline extends Applet implements ActionListener
: {
: Button pressMe = new Button("Press Me");
: int day;
:
: public void init() {
: add(pressMe);
: pressMe.addActionListener(this);
: day = 1;
: }
:
: public void actionPerformed(ActionEvent e)
: {
: if (day == 1)
: day = 0;
: else
: day = 1;
: repaint();
: }
:
:
:
:
:
Next step is to write the paint() method.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.