Observers and Observables Help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Observers and Observables Help

  1. #1
    Join Date
    Nov 2005
    Posts
    2

    Observers and Observables Help

    Hi, i'm new to the whole observer and observable thing and i was wondering how i would go about using observers and observables to create a fixed length bar chart from 3 seperate inputs accepted from a user which will display the bar in relation to the ratio? e.g..

    3 inputs: 10, 20, 20

    |-------|---------|--------|
    |-------|---------|--------|
    |--10 --|---20----|---20---|
    |-------|---------|--------|

    I understand how to create the user input (which i'll be using a GUI) and display the ratio but making the graph is something i don't know how to do. Any help or good online documents anyone knows about would be much appreciated.

    Thanks,

    Sandy.

  2. #2
    Join Date
    Oct 2005
    Posts
    107
    So which class is going to implement observer?
    Which class is going to extend Observable?

    Sounds like you start out asking about this, but you really want to know how to draw a bar graph using Java Graphics.

  3. #3
    Join Date
    Oct 2005
    Location
    Guadalajara, Jal. Mexico
    Posts
    5
    Neither do I understand why you need to use Observers and Observable classes in this exercise; probably you need to explain a little bit more your question.

    One of most common application of the Observer design pattern (http://www.dofactory.com/Patterns/PatternObserver.aspx) is in the MVC architectural pattern.

    In the following link you can find an example with a similar application of the observer design patter inside the MVC pattern, in which a temperature gauge increase according to the user inputs.

    http://csis.pace.edu/~bergin/mvc/mvcgui.html

    Greetings!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center