thank you for your response...
check out my steps
1. this is my SLinkedList.java file i compile and get the
Node.class, SLinkedList.class and ListEmptyException.class files:
Quote:package SLinkedList;
import java.io.*;
class SLinkedList {
private Node firstNode,lastNode;
public SLinkedList(){
firstNode = lastNode = null;
}
public Node getFirst(){
return firstNode;
}
public Node getLast(){
return lastNode;
}
public boolean isEmpty(){
return(firstNode==null);
}
public void insertFirst(Object newItem){
if (isEmpty()) firstNode = lastNode = new Node(newItem,null);
else firstNode = new Node(newItem,firstNode);
}
public void insertLast(Object newItem){
if (isEmpty()) firstNode = lastNode = new Node(newItem,null);
else lastNode = lastNode.next = new Node(newItem,null);
}
public Object removeFirst() throws ListEmptyException {
Object removeItem;
if (isEmpty()) throw new ListEmptyException ("Empty list.");
removeItem=firstNode.item;
if (firstNode.equals(lastNode)) firstNode = lastNode = null;
else firstNode = firstNode.next;
return removeItem;
}
public Object removeLast() throws ListEmptyException {
Object removeItem;
if (isEmpty()) throw new ListEmptyException ("Empty list.");
removeItem=lastNode.item;
if (firstNode.equals(lastNode)) firstNode = lastNode = null;
else {
Node current = firstNode;
while (current.next != lastNode) current=current.next;
lastNode = current;
current.next = null;
}
return removeItem;
}
public void printList() throws ListEmptyException{
if (isEmpty()) throw new ListEmptyException ("Empty list.");
else {
Node current=firstNode;
while(current != null) {
System.out.println(current.item.toString()+" ");
current = current.next;
}
System.out.println("\n");
}
}
}
class Node{
Object item;
Node next;
public Node(){
this(null,null);
}
public Node(Object it, Node n){
item = it;
next = n;
}
public void setItem(Object newItem){
item = newItem;
}
public Object getItem(){
return item;
}
public void setNext(Node n){
next = n;
}
public Node getNext(){
return next;
}
}
class ListEmptyException extends RuntimeException {
public ListEmptyException (String err){
super(err);
}
}
2.i go to the directory which contains the .class files and run
Quote:jar cvf SLinkedList.jar Node.class,ListEmptyException.class, SLinkedList.class
and i get the SLinkedList.jar file with the META-INF in it
3. I go to the processing\lybraries folder i create a folder named SLinkedList and a sub-folder named library and put the SLinkedList in the SLinkedList\library\SLinkedList.jar
4. i open processing go to import library i select slinkedlist but no text appears in the editor...i type
Quote: import Slinkedlist.*;
i get an error i type other different thing and even when it finds the library when i try to create a Node object i get an other error
HELLPPPPPPP
thnx