public Player() {

        _current = Status.STOP;
        _player = null;
        _index = -1;

        new JFXPanel();

        setBackground(Color.WHITE);
        SpringLayout layout = new SpringLayout();
        setLayout(layout);

        //Setting up the list.
        _myList = new JList<Song>(new DefaultListModel<Song>());
        _myList.setCellRenderer(new PlayerListCellRenderer());
        _myList.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        _myList.setDragEnabled(true);
        _myList.setDropMode(DropMode.INSERT);
        _myList.setTransferHandler(new ListTransferHandler());
        _myList.setBorder(null);
        _myList.setBackground(Color.WHITE);

        JScrollPane scrollPane = new JScrollPane(_myList);
        scrollPane.setBorder(new LineBorder(Color.BLACK, 3));
        scrollPane.setBackground(Color.WHITE);
        add(scrollPane);

        try {
            //Play
            _playEnabled  = new BeethovenIcon(getClass().getResource("Icons/play.png").toURI().toURL());
            _pauseEnabled = new BeethovenIcon(getClass().getResource("Icons/pause.png").toURI().toURL());
            _play = new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    play();
                }
            };
            _pause = new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    pause();
                }
            };
            _playPause = new JButton(_playEnabled);
            _playPause.setToolTipText("Play");
            _playPause.setBackground(Color.WHITE);
            _playPause.setBorder(null);
            _playPause.addActionListener(_play);



            //Back
            _back = new JButton(new BeethovenIcon(getClass().getResource("Icons/previous.png").toURI().toURL()));
            _back.setToolTipText("Previous");
            _back.setBackground(Color.WHITE);
            _back.setBorder(null);
            _back.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    back();
                }
            });

            //Stop
            _stop = new JButton(new BeethovenIcon(getClass().getResource("Icons/stop.png").toURI().toURL()));
            _stop.setToolTipText("Stop");
            _stop.setBackground(Color.WHITE);
            _stop.setBorder(null);
            _stop.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    stop();
                }
            });


            //Next
            _next = new JButton(new BeethovenIcon(getClass().getResource("Icons/next.png").toURI().toURL()));
            _next.setToolTipText("Next");
            _next.setBackground(Color.WHITE);
            _next.setBorder(null);
            _next.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    next();
                }
            });

            //Remove
            _remove = new JButton(new BeethovenIcon(getClass().getResource("Icons/minus.png").toURI().toURL()));
            _remove.setToolTipText("Remove");
            _remove.setBackground(Color.WHITE);
            _remove.setBorder(null);
            _remove.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    remove();
                }
            });

            //Shuffle
            _shuffle = new JButton(new BeethovenIcon(getClass().getResource("Icons/shuffle.png").toURI().toURL()));
            _shuffle.setToolTipText("Shuffle");
            _shuffle.setBackground(Color.WHITE);
            _shuffle.setBorder(null);
            _shuffle.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    shuffle();
                }
            });

        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }


        //Seek Bar
        _seek = new JProgressBar(0, 100);
        _seek.setBackground(Color.WHITE);
        _seek.setBorder(new LineBorder(Color.BLACK, 3));
        _seek.setToolTipText("Seek");
        _seek.setString("00:00/00:00");
        _seek.setStringPainted(true);
        _seek.addMouseListener(new MouseListener() {
            @Override
            public void mouseClicked(MouseEvent e) {
                switch(_current) {
                    case PLAY:
                    case PAUSE:
                        int time = (int)Math.round(((double)e.getX() / (double)_seek.getWidth()) * _seek.getMaximum());
                        _seek.setValue(time);
                        _seek.setString(timeToString((int)_player.getCurrentTime().toSeconds()) + "/" +
                                        timeToString(_myList.getModel().getElementAt(_index).getDuration()));
                        _player.seek(new Duration(time));
                        break;
                    default:
                        break;
                }
            }
            @Override
            public void mousePressed(MouseEvent e) {}
            @Override
            public void mouseReleased(MouseEvent e) {}
            @Override
            public void mouseEntered(MouseEvent e) {}
            @Override
            public void mouseExited(MouseEvent e) {}
        });

        Timer t = new Timer(50, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                _myList.updateUI();
                switch(_current) {
                    case PLAY:
                        if((int)_player.getCurrentTime().toMillis() > _seek.getMaximum())
                            _seek.setValue(_seek.getMaximum());
                        else
                            _seek.setValue((int) _player.getCurrentTime().toMillis());
                        _seek.setString(timeToString((int) _player.getCurrentTime().toSeconds()) + "/" +
                                timeToString(_myList.getModel().getElementAt(_index).getDuration()));
                        break;
                    case PAUSE:
                        break;
                    case STOP:
                        _seek.setValue(0);
                        break;
                }
            }
        });
        t.start();

        int spacing = 5;

        JToolBar toolBar = new JToolBar();
        toolBar.setBackground(Color.WHITE);
        toolBar.setBorder(null);
        toolBar.setFloatable(false);
        toolBar.setRollover(true);
        toolBar.add(_playPause);
        toolBar.addSeparator(new Dimension(spacing, 0));
        toolBar.add(_back);
        toolBar.addSeparator(new Dimension(spacing, 0));
        toolBar.add(_stop);
        toolBar.addSeparator(new Dimension(spacing, 0));
        toolBar.add(_next);
        toolBar.addSeparator(new Dimension(spacing, 0));
        toolBar.add(_remove);
        toolBar.addSeparator(new Dimension(spacing, 0));
        toolBar.add(_shuffle);
        toolBar.addSeparator(new Dimension(spacing, 0));
        toolBar.add(_seek);
        add(toolBar);

        //Volume Slider
        _volume = new JSlider(JSlider.VERTICAL, 0, 10, 5);
        _volume.setToolTipText("Volume");
        _volume.setBackground(Color.WHITE);
        _volume.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                if(_player != null)
                    _player.setVolume(((double)((JSlider) e.getSource()).getValue()) / 10);
            }
        });
        add(_volume);

        //Positioning

        layout.putConstraint(SpringLayout.NORTH, scrollPane,   1, SpringLayout.NORTH, this);
        layout.putConstraint(SpringLayout.EAST,  scrollPane,  -1, SpringLayout.WEST,  _volume);
        layout.putConstraint(SpringLayout.SOUTH, scrollPane, -31, SpringLayout.SOUTH, this);
        layout.putConstraint(SpringLayout.WEST,  scrollPane,   1, SpringLayout.WEST,  this);
        layout.putConstraint(SpringLayout.NORTH, toolBar,      1, SpringLayout.SOUTH, scrollPane);
        layout.putConstraint(SpringLayout.EAST,  toolBar,     -1, SpringLayout.WEST,  _volume);
        layout.putConstraint(SpringLayout.WEST,  toolBar,      1, SpringLayout.WEST,  this);
        layout.putConstraint(SpringLayout.NORTH, toolBar,      1, SpringLayout.SOUTH, scrollPane);
        layout.putConstraint(SpringLayout.NORTH, _volume,      1, SpringLayout.NORTH, this);
        layout.putConstraint(SpringLayout.EAST,  _volume,     -1, SpringLayout.EAST,  this);
        layout.putConstraint(SpringLayout.SOUTH, _volume,    -31, SpringLayout.SOUTH, this);


    }