• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Slider not working

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am writing an applet that will display me four different polygons using four buttons.Also, i have a slider that is used to change the sizes of the displayed shape.Using this slider, when for example a rectangle is displayed, moving it ahead will increase it's size and vice versa.

I wrote the code, but i cannot increase/decrease the size using slider.I am sure the slider can listen to the event.But, i am not sure where it's going wrong.Please help.

Note: I have four classes for the four polygons to initialize the co-ordinate points.




 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what is the maximum value on your Slider? Why are you dividing it by 100?
 
mansi gupte
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:So what is the maximum value on your Slider? Why are you dividing it by 100?





The maximum value is 100 , minimum is 0 and middle is 50.I got this formula from a book, (2^50 -1), for calculating the value when slider changes its position.
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . and what is the result when you divide the slide position by 100?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
72 posts and you still don't know better than to post oodles of commented-out code and excess vertical whitespace? Honestly, making your code and posts more readable is in your best interests.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic