I am trying to compile my java file here but I am getting 8 erros with the same sybmol : illegal start of an expression
here is my coding:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JChangeFont extends JApplet implements ActionListener
{
JLabel banner = new JLabel("Your Name");
int fontSize = 18;
Font theFont = new Font("TimesRoman",Font.BOLD, fontSize);
JButton button1 = new JButton("Press");
Container con = getContentPane();
FlowLayout flow = new FlowLayout();
public void init()
{
Container con = getContentPane();
FlowLayout flow = new FlowLayout();
con.setLayout(flow);
banner.setFont(theFont);
con.add(banner);
con.add(button1);
button1.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
Object source = e.getSource();
if (source == button1)
{
Font newFont = new Font("Helvetica",Font.ITALIC, fontSize + 10);
banner.setFont(newFont);
}
public static void main(String args[]);
{
JChangeFont applet = new JChangeFont();
Frame window = new Frame("JChangeFont");
window.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
applet.init();
window.add("Center", applet);
window.pack();
window.setVisible(true);
}
}
what is wrong with it? I just don't get it. I am stuck. Can you please give some hints.
Thanks a lot