Im using eclipse and I can't start this class, It won't let me. I have to keep the code without a static part, because the code welcomeHelp.addActionListener(this); has to work in a non-static zone. But I can't start the class without it being a non-static zone. Please help.
The Code:
package fire_programming.chat_client; import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class welcomeScreen implements ActionListener { /** * */ private static final long serialVersionUID = 1L; public void main(String[]args)throws Exception{ //Creates the JFrame and sets it's properties. JFrame welcomeFrame = new JFrame(); welcomeFrame.setSize(500, 500); welcomeFrame.setVisible(true); welcomeFrame.setTitle("Chat Client"); //Creates the JPanels and sets their properties. JPanel welcomePanel1 = new JPanel(new BorderLayout()); welcomePanel1.setVisible(true); //Creates the JButtons and sets their properties. JButton welcomeHelp = new JButton(); welcomeHelp.setVisible(true); welcomeHelp.setText("Help Menu"); welcomePanel1.add(welcomeHelp); welcomeHelp.addActionListener(this); } @Override public void actionPerformed(ActionEvent arg0) { } }