为什么大小是固定的
制定一个大小的Jpanel里面装两个list,list的大小怎么是固定的让我很理解,我用setbounds setsize都没有用
很奇怪
!有人知道什么鸢鹰吗?
我把部分代码贴一下,由于是一个播放器,不能全贴看不懂!
listPanel = new JPanel();
listPanel.setLayout(new BorderLayout());
listPanel.setBounds(new Rectangle(4,150,289,148));
listPanel.setBorder(BorderFactory.createEtchedBorder());
leftList = new List();
leftList.setBounds(new Rectangle(4,150,100,148));
//leftList.setLocation(4, 150);
//leftList.setSize(new Dimension(100,148));
listPanel.add(new JScrollPane(leftList),BorderLayout.WEST);
playList = new List();
playList.setBounds(new Rectangle(100, 150, 189, 148));
playList.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e) {
if(e.getClickCount() == 2){
playState();
}
}
});
listPanel.add(new JScrollPane(playList),BorderLayout.EAST);
cp.add(listPanel);
split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,leftList,playList);
split.setBorder(new EmptyBorder(0,0,0,0));
listPanel.add(split);