JList does not occupy all the space in the panel.
I am making a Contact Book application, where a JList displays all the contacts. The JList is inside a JPanel, and the problem that i'm having is that it isn't occupying all the space. I've attached a picture to illustrate what I mean:
Is there a way to fix this?
The relevant code is as follows:
Thanks for your help.
contactList = new JList(contactListModel);
ContactListCellRenderer renderer = new ContactListCellRenderer();
JPanel listPanel = new JPanel();
Re: JList does not occupy all the space in the panel.
You'll want to create and post an SSCCE for us to be able to do more than an ignorant guess as to your problem and its solution. I only hope and pray that you didn't create this gui with the NetBean's Swing code generator.