This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of React Cookbook: Recipes for Mastering the React Framework and have David Griffiths & Dawn Griffiths on-line!
See this thread for details.
Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Adjustment Listener

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone!
I am new to Java.I have a problem with handling the Adjustment event.I have an Applet which draws 'n' number of rectangles.There are some Buttons and textfields and scrollbars.
When the paint method draws the n number of rectangles(Using drawRect(.....)) i need to scroll and show the rectangles which were initially invisible.I tried to do something but was not able to get it correctly.Hope some one is gonna help me out!!!.
I will be glad to have a small Applet code to demonstrate this.
Thank You.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi mohan,
try using the default constructors of ur JScrollBar class coz they give u the default settings for the srollbar .jus handle the vent appropriatelty after that and it worls perfectly!!!
any troubles do get back
subha
 
Mohan Lavu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi subha,
The problem is not with the scrollbars and values.The problem fo rme is implementing the listener code.what should i do before i repaint it.Lemme put it more elaborately.My Applet has a width which is enough to view 5 rectangles.In the first run it is showing me the first five.when i scroll (horizontally)
Now the first one should disappear and Rectangles from 2 to 6 should appear.I dunno swing.So please stick to scrollbars instead of jscrollbars.Now i am doing AWT's.The problem is with code to be written for adjustmentValueChanged().
Thank you,
Mohan.
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic