public LoadingDialog()
    {
        super();

        setUndecorated(true);
        setModal(true);

        JPanel mainPanel = new JPanel();
        mainPanel.setPreferredSize(new Dimension(300, 250));
        mainPanel.setBorder(DefaultUIProvider.getDefaultEmptyEtchedBorder());

        BoxLayout boxLayout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS);
        mainPanel.setLayout(boxLayout);

        mainPanel.add(Box.createVerticalGlue());

        ImageIcon loaderImage = new ImageIcon(getClass().getResource("/img/loader.gif"));
        JLabel imageLabel = new JLabel(loaderImage);
        imageLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT);
        mainPanel.add(imageLabel);

        mainPanel.add(Box.createVerticalGlue());

        JLabel messageLabel = new JLabel("Подождите. Обращаюсь к базе..");
        messageLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT);
        mainPanel.add(messageLabel);
        
        mainPanel.add(Box.createVerticalStrut(10));

        setContentPane(mainPanel);

        setSize(300, 250);
    }