private void myInit() {
        tPanels = new ArrayList<>();
        Set<Tooth> teeth = appt.getPatient().getMouth().getTeeth();
        List<Tooth> top = new ArrayList<>();
        List<Tooth> topL = new ArrayList<>();
        List<Tooth> bot = new ArrayList<>();
        List<Tooth> botL = new ArrayList<>();


        //sorting teeth to the proper sectors
        for (Tooth t : teeth) {
            if (t.isTopFloor()) {
                if (t.isLeftSide()) {
                    topL.add(t);
                } else {
                    top.add(t);
                }
            } else {
                if (t.isLeftSide()) {
                    botL.add(t);
                } else {
                    bot.add(t);
                }
            }
        }

        //sorting teeth ascendlingly
        Collections.sort(bot);
        Collections.sort(botL);
        Collections.sort(top);
        Collections.sort(topL);

        //reversing order of right side of mouth (from patients view).
        Collections.reverse(bot);
        Collections.reverse(top);


        //adding all teeth to the mouht one by one from right to left, top first.
        Dimension dim = new Dimension(60, 15);
        int i = 8;
        for (Tooth t : top) {
            ToothPanel p = new ToothPanel(t);
            this.teethTopPanel.add(p);

            this.addListener(p);

            JLabel num = new JLabel(" " + i + "");
            JPanel pad = new JPanel();
            pad.setPreferredSize(dim);
            pad.setSize(dim);
            pad.setMinimumSize(dim);
            pad.add(num);
            this.teethPosPanel.add(pad);
            i--;
        }
        i++;
        for (Tooth t : topL) {
            ToothPanel p = new ToothPanel(t);
            this.teethTopPanel.add(p);

            this.addListener(p);

            JLabel num = new JLabel(" " + i + "");
            JPanel pad = new JPanel();
            pad.setPreferredSize(dim);
            pad.setSize(dim);
            pad.setMinimumSize(dim);
            pad.add(num);
            this.teethPosPanel.add(pad);
            i++;
        }
        for (Tooth t : bot) {
            ToothPanel p = new ToothPanel(t);
            this.addListener(p);
            this.teethBotPanel.add(p);
        }
        for (Tooth t : botL) {
            ToothPanel p = new ToothPanel(t);
            this.addListener(p);
            this.teethBotPanel.add(p);
        }

        //final touches to the gui.
        this.setInfoMouth(botL.get(0).getMouth());

        initStateChoosers();

        this.teethBotPanel.validate();
        this.teethTopPanel.validate();
        this.teethBotPanel.repaint();
        this.teethTopPanel.repaint();
    }