View Single Post
  #2 (permalink)  
Old 06-29-2007, 04:58 PM
JavaBean's Avatar
JavaBean JavaBean is offline
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
You are not changing the size of the text from your JSlider. You just try to redraw the text. Try changing the size of the font as follows:

Code:
Font font = g2.getFont().deriveFont(<modified-font-size-changed-by-jslider>);
instead of:

Code:
Font font = g2.getFont().deriveFont(20f);
You can just have a mapping between JSlider position and font size. Based on the position of JSlider, you can assign a new font size. It should work in that case.
Reply With Quote