Here is my problem, in my Java applet i got this textfield(txtNormalHours) and button(xml).
When I press this button program should create file foo.xml, but nothing happens, no errors.
Here is the funny part without that button code works fine and foo.xml is created so I think there is something wrong in my main program code?

I cannot figure what´s wrong.... If someone could tell me what to do.

Offcourse if there is easier way to write in to xml file please tell.

main program code:
  void button_actionPerformed(ActionEvent e) {
   String norm = txtNormalHours1.getText(); //get information from textfield
    FOO f1 = new FOO();
  try {

     FooHelper.write(f1, "foo.xml");

    } catch (Exception ex)
        { ex.printStackTrace();

FooHelper code:
package simple;

import java.beans.XMLEncoder;
import java.beans.XMLDecoder;

public class FooHelper {
    public static void write(FOO f, String filename) throws Exception{
        XMLEncoder encoder =
           new XMLEncoder(
              new BufferedOutputStream(
                new FileOutputStream(filename)));

FOO code:
package simple;

public class FOO {
   private String foo ;

   public void setFoo(String s) {
     foo = s;

   public String getFoo() {
     return foo;