import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
class Main extends JFrame
{
public Main(String st)
{
setLayout(null);
setDefaultCloseOperation(javax.swing. WindowConstants.DISPOSE_ON_CLOSE);
JLabel lab=new JLabel("Welcome "+st+"!! \n Click OK to Continue");
JButton OK = new JButton("OK");
OK.setMnemonic('k');
OK.addActionListener(
new ActionListener()
{
JButton OK;
public void actionPerformed(ActionEvent e)
{
Main();
}
});
lab.setBounds(10,10,500,20);
OK.setBounds (80,80,120,28);
add (OK);
add(lab);
setSize(300,200);
}
public Main()
{
super("Malay Synonym Word Checker");
JMenuBar bar = new JMenuBar();
setJMenuBar(bar);
JMenu fileMenu = new JMenu("File");
fileMenu.setMnemonic('F');
JMenu helpMenu = new JMenu("Help");
helpMenu.setMnemonic('r');
bar.add(fileMenu);
bar.add(helpMenu);
JMenuItem aboutItem = new JMenuItem("About");
aboutItem.setMnemonic('A');
aboutItem.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
JOptionPane.showMessageDialog(getRootPane(), "This is a final year project by \nNur Amillia bt Amran.", "About", JOptionPane.PLAIN_MESSAGE);
}
}
);
JMenuItem exitItem = new JMenuItem("Exit");
exitItem.setMnemonic('x');
exitItem.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
}
);
fileMenu.add(aboutItem);
fileMenu.addSeparator();
fileMenu.add(exitItem);
}
public static void main(String[] Args)
{
Main f =new Main();
JPanel mypane = new JPanel(new GridLayout(5,3));
//f.setLayout(null);
JButton Request = new JButton("REQUEST");....
..................................................
hai...I have problem when I have to call public Main() after clicking the OK button...this Main () should be written under the red color site..but when i called Main(),it said 'cannot find symbol'
what shoul i do??