import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
public class ScrollFont extends JApplet implements AdjustmentListener
{
/*<Applet code="ScrollFont.class" height=200 width=400>
</Applet>
*/
JLabel lbl;
JScrollBar bar;
public void init()
{
Container frame = getContentPane();
lbl = new JLabel(" Welcome to My Blog");
lbl.setForeground(Color.blue);
frame.setLayout(new BorderLayout());
bar=new JScrollBar(0,7,5,7,50);
bar.setToolTipText("Scroll to increase font size");
bar.addAdjustmentListener(this);
frame.add(lbl, BorderLayout.CENTER);
frame.add(bar,BorderLayout.NORTH);
}
public void adjustmentValueChanged(AdjustmentEvent e)
{
lbl.setFont(new Font("Helvetica", Font.BOLD,bar.getValue()));
}
}
गणपती बाप्पा मोरया
-
*Lord Ganesh Utsav is greatly celebrated All over India, especially in the
Maharashtra state .*
10 years ago