AddRecord Class - havin trouble with ScrollingPanel
Hi everybody!
I was working on this AddRecord class, unfortunately I keep gettin an error concerning the ScrollingPanel. I'm not really sure what's wrong with it. The errors are:
addrecord.java:9: cannot resolve symbol
symbol : class ScrollingPanel
location: class AddRecord
{private ScrollingPanel fields;
^
addrecord.java:13: cannot resolve symbol
symbol : class ScrollingPanel
location: class AddRecord
public AddRecord(Connection c, ScrollingPanel f, JTextArea o)
^
2 errors
if anyone can gimme a hint of what's wrong.. I'd really appreciate it! Thank ya!
-
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;
public class AddRecord implements ActionListener
{private ScrollingPanel fields;
private JTextArea output;
private Connection connection;
public AddRecord(Connection c, ScrollingPanel f, JTextArea o)
{
connection = c;
fields = f;
output = o;
}
public void actionPerformed(ActionEvent e)
{
try{
Statement statement = connection.createStatement();
if(!fields.last.getText().equals("") &&
!fields.first.getText().equals("")) {
String query = "Insert Student Information( " +
"firstname, lastname, test1, test2, test3, test4, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10" + ") VALUES (' " +
fields.first.getText() + " ', ' " +
fields.last.getText() + " ', ' " +
fields.test1.getText() + " ', ' " +
fields.test2.getText() + " ', ' " +
fields.test3.getText() + " ', ' " +
fields.test4.getText() + " ', ' " +
fields.homework.getText() + " ')";
output.append("\nSending query: " +
connection.nativeSQL(query) + "\n");
int result = statement.executeUpdate(query);
if (result == 1)
output.append("\nInsertion successful\n");
else {
output.append("\nInsertion failed\n");
fields.first.setText(" ");
fields.last.setText(" ");
fields.test1.setText(" ");
fields.test2.setText(" ");
fields.test3.setText(" ");
fields.test4.setText(" ");
fields.a1.setText(" ");
fields.a2.setText(" ");
fields.a3.setText(" ");
fields.a4.setText(" ");
fields.a5.setText(" ");
fields.a6.setText(" ");
fields.a7.setText(" ");
fields.a8.setText(" ");
fields.a9.setText(" ");
fields.a10.setText(" ");
}
}
else
output.append("\nEnter at least first and last name then press Add\n");
statement.close();
}
catch (SQLException sqlex){
sqlex.printStackTrace();
output.append(sqlex.toString() );
}
}
}

