I Guess I should post the server code too.
Quote:import processing.net.*;
import SpringGUI.*;
Server myServer;
SpringGUI gui;
void setup(){
frameRate(30);
size(480,320);
background(255);
myServer = new Server(this, 10020);
PFont font = loadFont("TrebuchetMS-11.vlw");
textFont(font);
background(0,0,0);
gui = new SpringGUI(this);
gui.addTextField("myTextField","Enter Name and Number Here",10,40,180,20);
gui.setBackground("myTextField",0,0,0);
gui.setForeground("myTextField",255,255,255);
gui.addTextField("time","Enter Time Here",10,80,180,20);
gui.setBackground("time",0,0,0);
gui.setForeground("time",255,255,255);
gui.addList("myList",200,10,260,200);
gui.setAllBackgrounds(54,54,54);
gui.setAllForegrounds(255,255,255);
gui.addButton("myButton","Send",200,230,260,20);
gui.setBackground("myButton",0,0,0);
gui.setForeground("myButton",255,255,255);
}
void draw(){
// background(0,0,0,10);
fill(0,0,0,7);
rect(0,0,width,height);
}
void handleEvent(String[] parameters){
if(parameters[0].equals("TextField")&¶meters[2].equals("returnPressed")){
String CallerID = gui.getText("myTextField");
if(!CallerID.equals("")){
CallerID += " " + gui.getText("time");
myServer.write(CallerID);
gui.setText("myTextField","");
background(255,255,255);
gui.addItem("myList", CallerID);
}
}
if(parameters[1].equals("myButton")&¶meters[2].equals("mousePressed")){
String reSend = gui.getSelectedItem("myList");
myServer.write(reSend);
background(255,255,255);
}
if(parameters[0].equals("Button")&¶meters[2].equals("mouseEntered")){
gui.setBackground(parameters[1],164,0,0);
}
else if(parameters[0].equals("Button")&& parameters[2].equals("mouseExited")){
gui.setBackground(parameters[1],64,64,64);
}
if ( parameters[0].equals("TextField") && parameters[2].equals("mouseEntered") ) {
gui.setBackground(parameters[1], 0,128,164);
}
else if ( parameters[0].equals("TextField") && parameters[2].equals("mouseExited") ) {
gui.setBackground(parameters[1], 64,64,64);
}
}