Increasing Font Size Dynamically
Friday, 31 January 2014Posted by
Amrishwa
0 Comments
To do this first of all we have to take jlabel1 and a jSlider1 on jSlider1StateChanged event we have to write this code so that when ever jSlider scroll the font size increases in jlabel
int f=0; //class level type variable
Font fg=null; //class level type variable
private void jSlider1StateChanged(javax.swing.event.ChangeEvent evt) {
int g=jSlider1.getValue();
f=g;
System.out.println(g);
Font o=new Font("SimHei",Font.BOLD, f);
fg=o;
jLabel2.setFont(o);
jLabel2.setText(“www.proamrishwas.blogspot.com”);
}
Subscribe to:
Post Comments (Atom)