popupOptionenMenuItem = new JMenuItem("Optionen");
    public SwingTrayPopup makeSwingPopup() {        final SwingTrayPopup popup = new SwingTrayPopup();        popupShowHideMenuItem = new JMenuItem("%Show");        popupShowHideMenuItem.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                if (!isVisible()) {                    setVisible(true);                    toFront();                    requestFocus();                }                else {                    setVisible(false);                }            }        });        popup.add(popupShowHideMenuItem);        popupOptionenMenuItem = new JMenuItem("Optionen");        popupOptionenMenuItem.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                showOptionsDialog();            }        });        popup.add(popupOptionenMenuItem);        IconManager im = IconManager.getInstance();        versteckenIcon = im.getIcon("hide");        zeigenIcon = im.getIcon("applejuice");        Icon aboutIcon = im.getIcon("about");        popupOptionenMenuItem.setIcon(im.getIcon("optionen"));        popupAboutMenuItem = new JMenuItem("&Info", aboutIcon);        popupAboutMenuItem.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                showAboutDialog();            }        });        popup.add(popupAboutMenuItem);        new Thread(){          public void run(){              final AJSettings ajSettings = ApplejuiceFassade.getInstance().getAJSettings();              final JSlider uploadSlider = new JSlider(JSlider.VERTICAL, 0, 50, (int) ajSettings.getMaxUploadInKB());              final JSlider downloadSlider = new JSlider(JSlider.VERTICAL, 0, 300, (int) ajSettings.getMaxDownloadInKB());              uploadSlider.setPaintLabels(true);              uploadSlider.setPaintTicks(true);              uploadSlider.setPaintTrack(true);              uploadSlider.setSnapToTicks(true);              downloadSlider.setPaintLabels(true);              downloadSlider.setPaintTicks(true);              downloadSlider.setPaintTrack(true);              downloadSlider.setSnapToTicks(true);              final JMenu uploadMenu = new JMenu("Upload");              final JMenu downloadMenu = new JMenu("Download");              JPanel uploadPanel = new JPanel(new BorderLayout());              JPanel downloadPanel = new JPanel(new BorderLayout());              final JLabel label1 = new JLabel("50 kb/s");              final JLabel label2 = new JLabel("50 kb/s");              label1.setText(Long.toString(ajSettings.getMaxUploadInKB()) + " kb/s");              label2.setText(Long.toString(ajSettings.getMaxDownloadInKB()) + " kb/s");              uploadPanel.add(label1, BorderLayout.NORTH);              uploadPanel.add(uploadSlider, BorderLayout.SOUTH);              uploadMenu.add(uploadPanel);              downloadPanel.add(label2, BorderLayout.NORTH);              downloadPanel.add(downloadSlider, BorderLayout.SOUTH);              downloadMenu.add(downloadPanel);              uploadSlider.addChangeListener(new ChangeListener() {                  public void stateChanged(ChangeEvent e) {                      JSlider slider = (JSlider) e.getSource();                      label1.setText(Integer.toString(slider.getValue()) + " kb/s");                  }              });              downloadSlider.addChangeListener(new ChangeListener() {                  public void stateChanged(ChangeEvent e) {                      JSlider slider = (JSlider) e.getSource();                      label2.setText(Integer.toString(slider.getValue()) + " kb/s");                  }              });              uploadSlider.addMouseListener(new MouseAdapter(){                  public void mouseReleased(MouseEvent e){                      if (uploadSlider.getValue() < uploadSlider.getMaximum()                          && uploadSlider.getValue() > 0){                          long down = downloadSlider.getValue() * 1024;                          long up = uploadSlider.getValue() * 1024;                          ApplejuiceFassade.getInstance().setMaxUpAndDown(up,                              down);                      }                      else{                          uploadSlider.setValue((int) ajSettings.getMaxUploadInKB());                      }                  }              });              downloadSlider.addMouseListener(new MouseAdapter(){                  public void mouseReleased(MouseEvent e){                      if (downloadSlider.getValue() < downloadSlider.getMaximum()                          && downloadSlider.getValue() > 0){                          long down = downloadSlider.getValue() * 1024;                          long up = uploadSlider.getValue() * 1024;                          ApplejuiceFassade.getInstance().setMaxUpAndDown(up,                              down);                      }                      else{                          downloadSlider.setValue((int) ajSettings.getMaxDownloadInKB());                      }                  }              });              SwingUtilities.invokeLater(new Runnable(){                  public void run(){                      popup.add(uploadMenu);                      popup.add(downloadMenu);                  }              });          }        }.start();        return popup;    }