Hi everyone, m new to this forum. i was wondering if someone could help me. i am new to java and am doing an application named workplanner. within it is a combobox that needs to listen to a button named add through if statements. for better understanding i will paste the code together with the errors i get.

Thanks so much in advance
here is the code:

/*
* workplanner.java
*
* Created on November 1, 2011, 5:00 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package workplanner;

/**
*
* @author Ludo
*/
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.text.DateFormat;
import java.util.Date;

public class MyTasks extends JFrame {
// Declare variables:
// array lists
String[] columnNames = {"Task", "Due Date", "Priority", "State", "Description"};
Object[][] data = new Object[25][5];
// table
JTable table = new JTable(data, columnNames) {
// sets the ability of the cells to be edited by the user

public boolean isCellEditable(int row, int column) {
return false;
// returns false, cannot be edited
}
};
// frames
JFrame frame, frame1;
// panels
JPanel buttonPanel, buttonPanel2, tablePanel, addPanel, editPanel;
// labels
JLabel labelGender, labelName, labelCourse, labelYear, labelID;
// text fields
JTextField txtTask, txtDueDate, txtDescription;
//combo boxes
JComboBox cmbPriority, cmbState;
// buttons
JButton btnAdd, btnEdit, btnDelete, btnSort, btnSave, btnAddInput, btnCancel;
// additionals
int keyCode, rowIndex, rowNumber, noOfTasks;
// button handler
ButtonHandler bh = new ButtonHandler();
public MyTasks() {
// setting/modifying table components
table.setSelectionMode(ListSelectionModel.SINGLE_S ELECTION);
table.getSelectionModel().addListSelectionListener (new RowListener());
table.getColumnModel().getColumn(1).setPreferredWi dth(200);
table.getColumnModel().getColumn(3).setPreferredWi dth(50);
table.getTableHeader().setResizingAllowed(false);
table.getTableHeader().setReorderingAllowed(false) ;
JScrollPane scrollPane = new JScrollPane(table);
// main buttons
btnAdd = new JButton("ADD");
btnAdd.addActionListener(bh);
btnEdit = new JButton("EDIT");
btnEdit.addActionListener(bh);
btnEdit.setEnabled(false); // disables the component
btnDelete = new JButton("DELETE");
btnDelete.addActionListener(bh);
btnDelete.setEnabled(false);
// disables the component
btnSort = new JButton("SORT");
btnSort.addActionListener(bh);
btnSave = new JButton("SAVE");
btnSave.addActionListener(bh);
// with button Listeners
// sub buttons
btnAddInput = new JButton("Add");
btnAddInput.addActionListener(bh);
btnCancel = new JButton("Cancel");
btnCancel.addActionListener(bh);
// set label names
labelGender = new JLabel("Task");
labelName = new JLabel("Due Date");
labelCourse = new JLabel("Priority");
labelYear = new JLabel("State");
labelID = new JLabel("Description");
// set text fields width
txtTask = new JTextField(20);
txtDueDate = new JTextField(20);
cmbPriority = new JComboBox();
cmbState = new JComboBox();
txtDescription = new JTextField(20);
txtDescription.setDocument(new JTextFieldLimit(1));
// limits the length of
// input: max of 1
txtDescription.addKeyListener(keyListener);
// accepts only numerals
txtDueDate = new JTextField(20);
txtDueDate.setDocument(new JTextFieldLimit(7)); // limits the length of input: // max of 7
txtDueDate.addKeyListener(keyListener);
// accepts only numerals
// main frame
// panel for the table
tablePanel = new JPanel();
tablePanel.setLayout(new BoxLayout(tablePanel, BoxLayout.PAGE_AXIS));
tablePanel.setBorder(BorderFactory.createEmptyBord er(10, 10, 0, 10));
tablePanel.add(table.getTableHeader());
tablePanel.add(table);
// panel for the main buttons
buttonPanel = new JPanel();
buttonPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
// positions the main buttons
c.gridx = 0;
c.gridy = 0;
c.ipady = 20;
c.insets = new Insets(10, 10, 10, 10);
c.fill = GridBagConstraints.HORIZONTAL;
buttonPanel.add(btnAdd, c);
c.gridx = 0;
c.gridy = 1;
c.fill = GridBagConstraints.HORIZONTAL;
c.ipady = 20;
c.insets = new Insets(10, 10, 10, 10);
buttonPanel.add(btnEdit, c);
c.gridx = 0;
c.gridy = 2;
c.fill = GridBagConstraints.HORIZONTAL;
c.ipady = 20;
c.insets = new Insets(10, 10, 10, 10);
buttonPanel.add(btnDelete, c);
c.gridx = 0;
c.gridy = 3;
c.ipady = 20;
c.insets = new Insets(10, 10, 10, 10);
c.fill = GridBagConstraints.HORIZONTAL;
buttonPanel.add(btnSort, c);
c.gridx = 0;
c.gridy = 4;
c.ipady = 20;
c.insets = new Insets(10, 10, 10, 10);
c.fill = GridBagConstraints.HORIZONTAL;
buttonPanel.add(btnSave, c);
frame = new JFrame("Task Database");
frame.setVisible(true);
frame.setResizable(false);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.add(tablePanel, BorderLayout.CENTER);
frame.add(buttonPanel, BorderLayout.EAST);
frame.pack();
// ADD frame
// panel for adding
addPanel = new JPanel();
addPanel.setLayout(new GridBagLayout());
// positions the components for adding
// labels
c.insets = new Insets(1, 0, 1, 1);
c.gridx = 0;
c.gridy = 0;
addPanel.add(labelID, c);
c.gridy = 1;
addPanel.add(labelName, c);
c.gridy = 2;
addPanel.add(labelCourse, c);
c.gridy = 3;
addPanel.add(labelYear, c);
c.gridy = 4;
addPanel.add(labelGender, c);
// text fields
c.gridx = 1;
c.gridy = 0;
c.ipady = 1;
addPanel.add(txtDueDate, c);
c.gridy = 1;
c.ipady = 1;
addPanel.add(txtTask, c);
c.gridy = 2;
c.ipady = 1;
addPanel.add(cmbPriority, c);
c.gridy = 3;
c.ipady = 1;
addPanel.add(txtDescription, c);
c.gridy = 4;
c.ipady = 1;
addPanel.add(cmbState, c);
// panel for other necessary buttons
buttonPanel2 = new JPanel();
buttonPanel2.setLayout(new GridLayout(1, 1));
buttonPanel2.add(btnAddInput);
buttonPanel2.add(btnCancel);
frame1 = new JFrame("Task Database");
frame1.setVisible(false);
frame1.setResizable(false);
frame1.setDefaultCloseOperation(HIDE_ON_CLOSE);
frame1.add(addPanel, BorderLayout.CENTER);
frame1.add(buttonPanel2, BorderLayout.PAGE_END);
frame1.pack();
}// end
KeyListener keyListener = new KeyListener() {
public void keyTyped(KeyEvent e) {
}
public void keyPressed(KeyEvent e) {
keyCode = e.getKeyCode();
if (!(keyCode >= 48 && keyCode <= 57) && !(keyCode >= 96 && keyCode <= 105)
&& !(keyCode >= 37 && keyCode <= 40) && !(keyCode == 127 || keyCode == 8)) {
txtDueDate.setEditable(false);
}
}
public void keyReleased(KeyEvent e) {
txtDueDate.setEditable(true);
}
};

class RowListener implements ListSelectionListener {
public void valueChanged(ListSelectionEvent event) {
if (event.getValueIsAdjusting()) {
rowIndex = table.getSelectedRow();
if (data[rowIndex][0] == null || data[rowIndex][0] == "") {
btnEdit.setEnabled(false);
btnDelete.setEnabled(false);
}
else {
btnEdit.setEnabled(true);
btnDelete.setEnabled(true);
}
}
}
}// end

class ButtonHandler implements ActionListener {

final String[] sList =
{
"Choose priority",
"High",
"Medium",
"Low",
};
JComboBox cmbPriority = new JComboBox(sList);
final String[] cList =
{
"Choose status",
"Complete",
"Incomplete"
};
JComboBox cmbState = new JComboBox(cList);
public void actionPerformed(ActionEvent e) {
try {
if (e.getActionCommand().equals("ADD")) {
// text fields for Student input data
txtTask.setText("");
for( int iCtr = 0; iCtr < sList.length; iCtr++ )
cmbPriority.addItem( sList[iCtr] );
for( int iCtr = 0; iCtr < cList.length; iCtr++ )
cmbState.addItem( cList[iCtr] );
txtDescription.setText("");
txtDueDate.setText("");
frame1.setTitle("Add New Task"); // title bar name for add
btnAddInput.setActionCommand("Add2");
btnAddInput.setText("ADD");
frame1.setVisible(true); // sets the visibility of frame1
}
else if (e.getActionCommand().equals("EDIT")) {
txtTask.setText(data[rowIndex][4] + ""); // will preview the ID
// input during Add
cmbState.addItem(data[rowIndex][1] + ""); // will preview the Name
// input during Add
cmbPriority.addItem(data[rowIndex][2] + ""); // will preview the
// Course input during
// Add
txtDescription.setText(data[rowIndex][3] + ""); // will preview the Year
// input during Add
txtDueDate.setText(data[rowIndex][0] + ""); // will preview the
// Gender input during
// Add
txtDueDate.setEditable(false); // forbids the user to edit the entered
// ID number
frame1.setTitle("Edit Task"); // title bar name for edit
btnAddInput.setActionCommand("Edit2");
btnAddInput.setText("ACCEPT");
frame1.setVisible(true); // sets the visibility of frame1
}
else if (e.getActionCommand().equals("DELETE")) {
int confirm = JOptionPane.showConfirmDialog(frame, "ARE YOU SURE?", "CONFIRM", JOptionPane.YES_NO_OPTION);
if (confirm == 0) {
rowIndex = table.getSelectedRow();
rowNumber = 0;
noOfTasks--;
for (int i = 0; i <= 10; i++) {
if (rowIndex != i && i <= noOfTasks) {
data[rowNumber][4] = data[i][4];
data[rowNumber][1] = data[i][1];
data[rowNumber][2] = data[i][2];
data[rowNumber][3] = data[i][3];
data[rowNumber][0] = data[i][0];
rowNumber++;
}
else if (rowIndex != i && i > noOfTasks) {
data[rowNumber][4] = "";
data[rowNumber][1] = "";
data[rowNumber][2] = "";
data[rowNumber][3] = "";
data[rowNumber][0] = "";
rowNumber++;
}
}
if (noOfTasks == 200) // if the number of students id equal
// to 50, can no longer add students
btnAdd.setEnabled(false);
else
btnAdd.setEnabled(true); // continues to add students if
// not equal to 50
if (noOfTasks == 0) {
btnDelete.setEnabled(false);
btnEdit.setEnabled(false);
}
else {
btnDelete.setEnabled(true);
btnEdit.setEnabled(true);
}
rowIndex = table.getSelectedRow();
if (data[rowIndex][0] == null || data[rowIndex][0] == "") {
btnEdit.setEnabled(false);
btnDelete.setEnabled(false);
}
else {
btnEdit.setEnabled(true);
btnDelete.setEnabled(true);
}
table.updateUI();
}
}
else if (e.getActionCommand().equals("Add2")) {
if (txtDueDate.getText().isEmpty() || txtTask.getText().isEmpty() || cmbState.target()// /
|| cmbPriority.target() || txtDescription.getText().isEmpty()) {
JOptionPane.showMessageDialog(null, "PLEASE FILL IN THE BLANKS.", "ERROR!", JOptionPane.ERROR_MESSAGE);
}
else {
int dup = 0;
for (int i = 0; i < 10; i++) {
if (txtDueDate.getText().equals(data[i][0])) {
JOptionPane.showMessageDialog(null, "ID NUMBER ALREADY EXISTS.", "ERROR!", JOptionPane.ERROR_MESSAGE);
dup++;
break;
}
}
if (dup == 0) {
rowIndex = table.getSelectedRow();
data[noOfTasks][4] = txtDueDate.getText();
data[noOfTasks][1] = cmbState.insets();
data[noOfTasks][2] = cmbPriority.insets();
data[noOfTasks][3] = txtDescription.getText();
data[noOfTasks][0] = txtTask.getText();
table.updateUI();
frame1.dispose();
noOfTasks++;
if (noOfTasks == 200)
btnAdd.setEnabled(false);
else
btnAdd.setEnabled(true);
if (data[rowIndex][0] == null) {
btnEdit.setEnabled(false);
btnDelete.setEnabled(false);
}
else {
btnEdit.setEnabled(true);
btnDelete.setEnabled(true);
}
}
}
table.updateUI();
}
else if (e.getActionCommand().equals("Edit2")) {
if (txtTask.getText().isEmpty() || txtDueDate.getText().isEmpty() || cmbState.insets().isEmpty() || cmbPriority.insets().isEmpty()
|| txtDescription.getText().isEmpty()) {
JOptionPane.showMessageDialog(null, "INCOMPLETE INPUT.", "ERROR!", JOptionPane.ERROR_MESSAGE);
}
else {
data[rowIndex][4] = txtDueDate.getText();
data[rowIndex][1] = cmbState.insets();
data[rowIndex][2] = cmbPriority.insets();
data[rowIndex][3] = txtDescription.getText();
data[rowIndex][0] = txtTask.getText();
frame1.dispose();
}
table.updateUI();
}
else if (e.getActionCommand().equals("Cancel")) {
frame1.dispose();
}
}
catch (Exception error) {
}
}
}// end

class JTextFieldLimit extends PlainDocument {
private int limit;
JTextFieldLimit(int limit) {
super();
this.limit = limit;
}
JTextFieldLimit(int limit, boolean upper) {
super();
this.limit = limit;
}
public void insertString(int offset, String str, AttributeSet attr)
throws BadLocationException {
if (str == null)
return;
if ((getLength() + str.length()) <= limit) {
super.insertString(offset, str, attr);
}
}
}// end
public static void main(String[] args) {
new MyTasks();
}// end of main
}// end of class

and below are the errors i get when trying to change some textfields to comboboxes:

init:
deps-jar:
Compiling 1 source file to C:\Users\Ludo\WorkPlanner\build\classes
C:\Users\Ludo\WorkPlanner\src\workplanner\MyTasks. java:337: cannot find symbol
symbol : method target()
location: class javax.swing.JComboBox
if (txtDueDate.getText().isEmpty() || txtTask.getText().isEmpty() || cmbState.target()// /
C:\Users\Ludo\WorkPlanner\src\workplanner\MyTasks. java:338: cannot find symbol
symbol : method target()
location: class javax.swing.JComboBox
|| cmbPriority.target() || txtDescription.getText().isEmpty()) {
C:\Users\Ludo\WorkPlanner\src\workplanner\MyTasks. java:377: cannot find symbol
symbol : method isEmpty()
location: class java.awt.Insets
if (txtTask.getText().isEmpty() || txtDueDate.getText().isEmpty() || cmbState.insets().isEmpty() || cmbPriority.insets().isEmpty()
C:\Users\Ludo\WorkPlanner\src\workplanner\MyTasks. java:377: cannot find symbol
symbol : method isEmpty()
location: class java.awt.Insets
if (txtTask.getText().isEmpty() || txtDueDate.getText().isEmpty() || cmbState.insets().isEmpty() || cmbPriority.insets().isEmpty()
Note: C:\Users\Ludo\WorkPlanner\src\workplanner\MyTasks. java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
BUILD FAILED (total time: 0 seconds)