// create an instance of PickleButton
PickleButton b = new PickleButton();
// set the properties
Font ft = new Font("System", Font.BOLD, 36);
b.setFont(ft);
b.setLabel("Sour Pickle");
// serialize the pickle button
try
{
FileOutputStream f = new FileOutputStream("PickleButton.ser");
ObjectOutputStream s = new ObjectOutputStream(f);
s.writeObject(b);
s.flush();
}
catch (Exception e)
{
System.out.println(e);
}
add(b);