public static void main(String[] args)
  {
    /* theme
    try
    {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch(UnsupportedLookAndFeelException e)
    {
    }
    catch(ClassNotFoundException e)
    {
    }
    catch(InstantiationException e)
    {
    }
    catch(IllegalAccessException e)
    {
    }
    */

    // set window size
    Dimension dim = new Dimension(512, 384);

    final JoeClient joe = new JoeClient();

    JFrame frame = new JFrame("JoeClient");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setLayout(new BorderLayout());
    frame.setPreferredSize(dim);
    frame.setMinimumSize(dim);
   
    frame.add(joe.panel);

    MainMenu menu = new MainMenu(joe);
    frame.setJMenuBar(menu);

    frame.setSize(dim.width, dim.height);
    frame.setVisible(true);

    //win = SwingUtilities.windowForComponent(frame);
    joe.win = (Frame)frame;

    new Thread()
    {
      int bump = 0;

      public void run()
      {
        while(true)
        {
          // try to stay connected
          try
          {
            Thread.sleep(500);
            bump++;
            if(bump > 120)
            {
              bump = 0;
              if(joe.chat.connected && joe.cd.keep_alive.isSelected())
              {
                try
                {
                  joe.chat.out.write("\n");
                  joe.chat.out.flush();
                }
                catch(IOException e)
                {
                }
              }
            }
          }
          catch(InterruptedException e)
          {
          }
        }
      }
    }.start();
  }