Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change font size of button if button size changes

 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to change font size i.e increment or decrement , if button size is incremented or decremented..

I am using Component Listner.

 
Sriraman Srinivasan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use componentResized method of Component Listener to know resizing of the component. In this method you can change the font and repaint the component.
 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shreeram,
I am using component listner... and it changes values also. but the issue is i could not determine how to change font size..




In getFormatLable method I wrote function to set font size and other parameters.
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use getFont, Font.deriveFont and setFont.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic