ApplejuiceFassade.getInstance().processLink(link);
ApplejuiceFassade.getInstance().processLink(link, "");
	private void init() throws Exception {		setLayout(new BorderLayout());		LanguageSelector.getInstance().addLanguageListener(this);		sucheServer.setForeground(Color.BLUE);		IconManager im = IconManager.getInstance();		verbinden = new JMenuItem();		verbinden.setIcon(im.getIcon("serververbinden"));		hinzufuegen1 = new JMenuItem();		hinzufuegen1.setIcon(im.getIcon("serverneu"));		loeschen1 = new JMenuItem();		loeschen1.setIcon(im.getIcon("serverloeschen"));		hinzufuegen2 = new JMenuItem();		hinzufuegen2.setIcon(im.getIcon("serverneu"));		hinzufuegen3 = new JMenuItem();		hinzufuegen3.setIcon(im.getIcon("serverneu"));		loeschen2 = new JMenuItem();		loeschen2.setIcon(im.getIcon("serverloeschen"));		itemCopyToClipboard = new JMenuItem();		itemCopyToClipboard.setIcon(im.getIcon("clipboard"));		popup.add(verbinden);		popup.add(hinzufuegen3);		popup.add(itemCopyToClipboard);		popup.add(loeschen1);		popup2.add(hinzufuegen2);		popup3.add(hinzufuegen1);		popup3.add(loeschen2);		verbinden.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent ae) {				int selected = serverTable.getSelectedRow();				ServerDO server = (ServerDO) ((ServerTableModel) serverTable						.getModel()).getRow(selected);				ApplejuiceFassade af = ApplejuiceFassade.getInstance();				if (af.getInformation().getVerbindungsStatus() == Information.VERBUNDEN) {					NetworkInfo netInfo = af.getNetworkInfo();					long timestamp = af.getLastCoreTimestamp();					if (timestamp == 0) {						/*						 * Es wurden noch keine Referenzdaten geholt. Wir nehmen						 * die eigene Zeit, in der Hoffnung, dass die						 * uebereinstimmen.						 */						timestamp = System.currentTimeMillis();					}					long timeDiff = timestamp - netInfo.getConnectionTime();					int minuten = (int) (timeDiff / 60000);					if (minuten < 0) {						minuten = 0;					}					if (minuten <= 30) {						String tmp = warnungNachricht.replaceAll("%s", Integer								.toString(minuten));						int result = JOptionPane.showConfirmDialog(								AppleJuiceDialog.getApp(), tmp, warnungTitel,								JOptionPane.YES_NO_OPTION);						if (result != JOptionPane.YES_OPTION) {							return;						}					}				}				ApplejuiceFassade.getInstance().connectToServer(server.getID());				SoundPlayer.getInstance().playSound(SoundPlayer.VERBINDEN);			}		});		ActionListener loescheServerListener = new ActionListener() {			public void actionPerformed(ActionEvent ae) {				int selected[] = serverTable.getSelectedRows();				if (selected.length > 0) {					ServerDO server = null;					for (int i = 0; i < selected.length; i++) {						server = (ServerDO) ((ServerTableModel) serverTable								.getModel()).getRow(selected[i]);						if (server != null) {							ApplejuiceFassade.getInstance().entferneServer(									server.getID());						}					}				}			}		};		ActionListener clipboardListener = new ActionListener() {			public void actionPerformed(ActionEvent ae) {				int[] selectedItems = serverTable.getSelectedRows();				if (selectedItems.length == 1) {					Clipboard cb = Toolkit.getDefaultToolkit()							.getSystemClipboard();					StringBuffer toCopy = new StringBuffer();					toCopy.append("ajfsp://server|");					ServerDO serverDO = (ServerDO) ((ServerTableModel) serverTable							.getModel()).getRow(selectedItems[0]);					toCopy.append(serverDO.getHost());					toCopy.append("|");					toCopy.append(serverDO.getPort());					toCopy.append("/");					StringSelection contents = new StringSelection(toCopy							.toString());					cb.setContents(contents, null);				}			}		};		itemCopyToClipboard.addActionListener(clipboardListener);		loeschen1.addActionListener(loescheServerListener);		loeschen2.addActionListener(loescheServerListener);		ActionListener newServerListener = new ActionListener() {			public void actionPerformed(ActionEvent ae) {				NewServerDialog newServerDialog = new NewServerDialog(						AppleJuiceDialog.getApp(), true);				Dimension appDimension = newServerDialog.getSize();				Dimension screenSize = Toolkit.getDefaultToolkit()						.getScreenSize();				newServerDialog.setLocation(						(screenSize.width - appDimension.width) / 2,						(screenSize.height - appDimension.height) / 2);				newServerDialog.setVisible(true);				if (newServerDialog.isLegal()) {					final String link = newServerDialog.getLink();					new Thread() {						public void run() {							ApplejuiceFassade.getInstance().processLink(link);						}					}.start();				}			}		};		hinzufuegen2.addActionListener(newServerListener);		hinzufuegen3.addActionListener(newServerListener);		hinzufuegen1.addActionListener(newServerListener);		JPanel panel1 = new JPanel();		panel1.setLayout(new GridBagLayout());		GridBagConstraints constraints = new GridBagConstraints();		constraints.anchor = GridBagConstraints.NORTH;		constraints.fill = GridBagConstraints.BOTH;		constraints.gridx = 0;		constraints.gridy = 0;		sucheServer.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent ae) {				Thread worker = new Thread() {					public void run() {						ApplejuiceFassade af = ApplejuiceFassade.getInstance();						String[] server = af.getNetworkKnownServers();						if (server == null || server.length == 0) {							return;						}						for (int i = 0; i < server.length; i++) {							af.processLink(server[i]);						}					}				};				worker.start();			}		});		panel1.add(sucheServer, constraints);		constraints.gridx = 1;		constraints.weightx = 1;		panel1.add(new JLabel(), constraints);		add(panel1, BorderLayout.NORTH);		serverTable = new JTable();		serverTable.setModel(new ServerTableModel());		serverTable.setShowGrid(false);		serverTable				.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);		SortButtonRenderer renderer = new SortButtonRenderer();		TableColumnModel model = serverTable.getColumnModel();		int n = model.getColumnCount();		for (int i = 0; i < n; i++) {			model.getColumn(i).setHeaderRenderer(renderer);			model.getColumn(i).setPreferredWidth(model.getColumn(i).getWidth());		}		JTableHeader header = serverTable.getTableHeader();		header.addMouseListener(new HeaderListener(header, renderer));		TableColumn tc = serverTable.getColumnModel().getColumn(0);		tc.setCellRenderer(new ServerTableCellRenderer());		final JScrollPane aScrollPane = new JScrollPane(serverTable);		aScrollPane.setBackground(serverTable.getBackground());		serverTable.getTableHeader().setBackground(serverTable.getBackground());		aScrollPane.getViewport().setOpaque(false);		MouseAdapter popupMouseAdapter = new MouseAdapter() {			public void mousePressed(MouseEvent me) {				super.mouseReleased(me);				maybeShowPopup(me);			}			public void mouseReleased(MouseEvent e) {				super.mouseReleased(e);				maybeShowPopup(e);			}			private void maybeShowPopup(MouseEvent e) {				if (e.isPopupTrigger()) {					int selectedRow = serverTable.rowAtPoint(e.getPoint());					if (selectedRow != -1) {						if (serverTable.getSelectedRowCount() == 0) {							serverTable.setRowSelectionInterval(selectedRow,									selectedRow);						} else {							int[] currentSelectedRows = serverTable									.getSelectedRows();							for (int i = 0; i < currentSelectedRows.length; i++) {								if (currentSelectedRows[i] == selectedRow) {									selectedRow = -1;									break;								}							}							if (selectedRow != -1) {								serverTable.setRowSelectionInterval(										selectedRow, selectedRow);							}						}					}					if (serverTable.getSelectedRowCount() == 1) {						popup.show(aScrollPane, e.getX(), e.getY());					} else if (serverTable.getSelectedRowCount() > 1) {						popup3.show(aScrollPane, e.getX(), e.getY());					} else {						popup2.show(aScrollPane, e.getX(), e.getY());					}				}			}		};		aScrollPane.addMouseListener(popupMouseAdapter);		serverTable.addMouseListener(popupMouseAdapter);		add(aScrollPane, BorderLayout.CENTER);		JPanel legende = new JPanel(new FlowLayout());		ImageIcon icon1 = im.getIcon("serververbunden");		ImageIcon icon2 = im.getIcon("serverversuche");		ImageIcon icon3 = im.getIcon("aelter24h");		ImageIcon icon4 = im.getIcon("juenger24h");		JLabel label1 = new JLabel(icon1);		JLabel label2 = new JLabel(icon2);		JLabel label3 = new JLabel(icon3);		JLabel label4 = new JLabel(icon4);		legende.add(label1);		legende.add(verbunden);		legende.add(label2);		legende.add(versucheZuVerbinden);		legende.add(label3);		legende.add(aelter24h);		legende.add(label4);		legende.add(juenger24h);		add(legende, BorderLayout.SOUTH);		ApplejuiceFassade.getInstance().addDataUpdateListener(this,				DataUpdateListener.SERVER_CHANGED);	}