[thelist] JAVA - call to super must be first statement in constructor error - but it is!
jason h
jayuk_1 at hotmail.com
Mon Mar 19 11:52:21 CDT 2007
I'm getting the error "call to super must be first statement in constructor"
which is a bit random as it is the first statement in the constructor.. i
can't figure it, hope someone can help. some of my code:
// Fig. 18.5: Client.java
// Client that reads and displays information sent from a Server.
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Client extends JFrame {
private JTextField enterField;
private JTextArea displayArea;
private ObjectOutputStream output;
private ObjectInputStream input;
private String message = "";
private String chatServer;
private Socket client;
private String tempArray[];
private EmployeeGUI userInterface;
private JButton saveRecordButton, saveFileButton, nextRecordButton,
loadButton, exitButton;
private int tempArrayCount = 0;
// set up GUI
public void createEmployee()
{
super( "Creating a Sequential File of employees" ); //<--##**
ERROR LINE!
// create instance of reusable user interface
userInterface = new EmployeeGUI( 5 ); // five textfields
getContentPane().add( userInterface, BorderLayout.CENTER );
and the main method (if that helps):
public static void main( String args[] )
{
Client application;
if ( args.length == 0 )
application = new Client( "127.0.0.1" );
else
application = new Client( args[ 0 ] );
application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
application.runClient();
new createEmployee();
}
_________________________________________________________________
Txt a lot? Get Messenger FREE on your mobile.
https://livemessenger.mobile.uk.msn.com/
More information about the thelist
mailing list