public JPanel CreatGui(){

        int NumberOfServer = serverlist.size();

        tabbedPane = new JTabbedPane();
        ImageIcon icon = createImageIcon("glorous28.png");
        for(int i =0; i < NumberOfServer; i++){
            TABID[CurrentTab] = i;
            CurrentTab += 1;

            ArrayList<JTextArea> serverTextObject = new ArrayList<JTextArea>();
            ArrayList<JTextPane> serverObjects = new ArrayList<JTextPane>();

            JPanel tempPanel2 = new JPanel();
            tempPanel2.setLayout(new GridLayout(2, 0));
            tempPanel2.setVisible(true);
            tempPanel2.setPreferredSize(new Dimension(480, 300));
            JComponent panel;
            if(!catalogue.getmanualServer()) {
                panel = makeTextPanel("Server: " + Server.getServer((String) serverlist.get(i)).getName() + " IP:" +
                        Server.getServer((String) serverlist.get(i)).getIp() + " Port: " + Server.getServer((String)
                        serverlist.get(i)).getPort());
            }
            else{
                panel = makeTextPanel("Server: ");
            }
            panel.setPreferredSize(new Dimension(300, 50));
            panel.setBackground(new Color(Loop254(i, 0), Loop254(i, 1), Loop254(i, 2)));

            JPanel tempPanel3 = new JPanel();
            tempPanel3.setLayout(new GridLayout(3, 0));
            tempPanel3.add(panel);
            tempPanel2.add(tempPanel3);

            final JTextArea inputArea = defineInputarea();
            JScrollPane jScrollPane2 = new JScrollPane();
            serverTextObject.add(inputArea);
            jScrollPane2.getViewport().add(inputArea);
            inputArea.setPreferredSize(new Dimension(330, 120));
            inputArea.setLineWrap(true);
            inputArea.setFont(new Font("Courier New", Font.BOLD, 12));
            inputArea.setWrapStyleWord(true);


            JButton sendMessage = new JButton("Send");
            JButton connectButton = new JButton("Connect");
            JButton disConnectButton = new JButton("Disconnect");
            JButton setkey = new JButton("Set key");
            JCheckBox Compress = new JCheckBox("Compress");
            JCheckBox Encrypted = new JCheckBox("Encrypted");


            connectButton.setPreferredSize(new Dimension(150, 30));
            disConnectButton.setPreferredSize(new Dimension(150, 30));
            setkey.setPreferredSize(new Dimension(90, 20));
            disConnectButton.setEnabled(false);
            setkey.setEnabled(false);

            JTextPane Key = new JTextPane();
            Key.setPreferredSize(new Dimension(120, 20));

            JPanel tempPanel6 = new JPanel();
            JPanel tempBlankPanel = new JPanel();
            JPanel tempencryptplane = new JPanel();

            tempencryptplane.setLayout(new FlowLayout());
            tempPanel6.setLayout(new FlowLayout());

            tempPanel6.add(tempBlankPanel);
            tempPanel6.add(connectButton);
            tempPanel6.add(disConnectButton);

            tempPanel3.add(tempPanel6);
            tempencryptplane.add(Compress);
            tempencryptplane.add(Encrypted);
            tempencryptplane.add(Key);
            tempencryptplane.add(setkey);
            tempPanel3.add(tempencryptplane);

            sendMessage.addActionListener(this);
            connectButton.addActionListener(this);
            disConnectButton.addActionListener(this);
            setkey.addActionListener(this);

            Buttons.add(sendMessage);
            ActionPlanes.add(inputArea);

            JPanel tempPanel5 = new JPanel();
            tempPanel5.setLayout(new FlowLayout());

            JPanel tempPanel4 = new JPanel();
            tempPanel4.setPreferredSize(new Dimension(480, 300));
            tempPanel5.add(jScrollPane2);
            tempPanel5.add(sendMessage);
            tempPanel5.add(tempPanel4);
            tempPanel2.add(tempPanel5);

            JPanel tempPanel = new JPanel();
            tempPanel.setLayout(new GridLayout(2, 0));
            JTextPane outputArea = defineOutputarea();
            serverObjects.add(outputArea);
            outputAreaList.add(outputArea);
            outputArea.setPreferredSize(new Dimension(18, 10));

            JScrollPane jScrollPane1 = new JScrollPane();
            jScrollPane1.getViewport().add(outputArea);
            jScrollPane1.setPreferredSize(new Dimension(18, 10));

            //outputArea.setPreferredSize(new Dimension(400, 500));
            tempPanel.add(jScrollPane1);
            tempPanel.add(tempPanel2);

            //build layout
            String serverName = Server.getServer((String)serverlist.get(i)).getName();
            if(serverName.length()> 5){
                serverName = serverName.substring(0,5) + "..";
            }

            tabbedPane.addTab(serverName, icon, tempPanel, "Name: " + Server.getServer((String)serverlist.get(i)).getName());
            tabs.add(tempPanel);
            tabbedPane.setMnemonicAt(i,KeyEvent.VK_ADD);
            serverPlanes.add(serverObjects);
            serverJTextField.add(serverTextObject);

            //##############################################################################
            //Creat all arraylists needed (to be able to get the objects later on)
            // inputArea,disConnectButton,sendMessage,Compress,Encrypted,Key
            // connectButton
            //##############################################################################

            inputArea.setEnabled(false);
            disConnectButton.setEnabled(false);
            sendMessage.setEnabled(false);
            Compress.setEnabled(false);
            Encrypted.setEnabled(false);
            Key.setEnabled(false);

            JButton[] buttonList = new JButton[]{connectButton, disConnectButton, sendMessage, setkey};
            JCheckBox[] boxesList = new JCheckBox[]{Compress,Encrypted};
            JTextPane[] textAreas = new JTextPane[]{Key};
            JTextArea[] textAreasfields = new JTextArea[]{inputArea};

            ArrayList<Object> ClientContent = new ArrayList<Object>();

            ClientContent.add(buttonList);
            ClientContent.add(boxesList);
            ClientContent.add(textAreas);
            ClientContent.add(textAreasfields);

            Runnable r = new Runnable() {
                @Override
                public void run() {
                    new keycheker().enterKeyAction(inputArea);
                }
            };
            EventQueue.invokeLater(r);

            Client_Content.add(ClientContent);
            if(catalogue.getmanualServer()){
                i = NumberOfServer;
            }


        }
        panelOne.add(tabbedPane);
        tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        return panelOne;
    }