I dont want that JList changed like that . Please help me . I want JList's size isn't changed .
Joined: Jun 09, 2003
if you want the JList to be left half of the frame, set the frame as a gridlayout 1 row 2 colums, and add the scrollpane(containing the JList) directly to the frame. it will then occupy the left half of whatever size the frame is.
something like this
Joined: Aug 20, 2004
Hi Anh Vu
You only need to add one code, please see below:
------------- jScrollPane1.setPreferredSize(new Dimension(150, 20)); //Note: The jScrollPane1 is the perent of the JList. Set its preferred width to be 150, or whatever you prefer.