JScrollPane not working in my code
<p>Here, My Jscrollpane isn't working. I have added the scrollpane and list both on main Jpanel. The Jlist is working, But it seems, JScrollpane Not working in this code.</p>

<p>my main class extends Jframe, so from main class i just pass the main panel, and working on the same panel.
and here i'm using absolute layout.</p>

<pre><code>public class ExternalsLinks extends JPanel {

        ///Links List
        private JList mainList;

        ///List Custom Border
        Border lineBorder = BorderFactory.createLineBorder(Color.BLACK, 5);

        ///Main Jpanel
        private JPanel mainPanel;

        ///Scroll Pane for Lists
        private JScrollPane mainListScrollPane;

        /// Lebels
        private JLabel lblExternalLinks;

        ///Buttons
        private Button btnBackCredits = new Button("Back");

        ///Button Properties
        private final int BUTTON_X = 220; private final int BUTTON_Y = 450;
        private final int BUTTON_X_LENGTH = 350; private final int BUTTON_Y_LENGTH = 50;

        ///List Options
        private String [] listMenu = {"Searching", "Sorting"};

        ///Constructors
        public ExternalsLinks(JPanel mainPanel) {

            this.mainPanel = mainPanel;
            this.mainPanel.setLayout(null);

            mainPanel.setBackground(Color.WHITE);

            initialize_All();
        }

        /// Initialize method to initialize all components to JFrame
        private void initialize_All() {

            ///Main Panel Components

            lblExternalLinks = new JLabel("\"External Links\"");
            lblExternalLinks.setBounds(290, 0, 400, 100);
            lblExternalLinks.setFont(new Font("courier", Font.BOLD, 30));
            mainPanel.add(lblExternalLinks);

            mainList = new JList(listMenu);
            mainList.setBackground(Color.CYAN);
            mainList.setForeground(Color.BLACK);
            mainList.setFont(new Font("Calibiri", Font.BOLD, 25));

            mainList.setVisibleRowCount(2);
            mainList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

            mainList.setBorder(lineBorder);
            mainList.setBounds(50, 80, 300, 350);

            mainListScrollPane = new JScrollPane();
            mainPanel.add(mainListScrollPane);
            mainPanel.add(mainList);





            ///Buttons
            btnBackCredits.setBounds(BUTTON_X, BUTTON_Y, BUTTON_X_LENGTH, BUTTON_Y_LENGTH);
            mainPanel.add(btnBackCredits);

            btnBackCredits.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent arg0) {
                    mainList.setVisible(false);

                    mainPanel.removeAll();
                    new MainMenu(mainPanel);
                }
            });
        }
    }
</code></pre>