listPanel = new JPanel();
listPanel.setLayout(new FlowLayout());
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));
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));
cp.add(listPanel);
listPanel.setLayout(new FlowLayout());
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));
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));
cp.add(listPanel);
解决方案 »
- inputStream读入文件
- Flash Builder 4 安装报错
- java 中连接各种数据库的代码
- java去做界面是不是一定要写代码的?没有可视化的工具吗?
- Jfreechart 中DisplayChart找不到
- 请问JComboBox中setEnabled(boolean enable)
- java中,如何用鼠标动态改变一个图片的大小?
- 我写的扫雷, (新版),保正好,来的有分
- 急!高手请进,救命啊
- Map中的containsKey方法
- [求助]我想分隔字符串如何处理?
- 一个java正则表达式的问题( Pattern p=Pattern.compile( "(\\d(,\\d)*|)" ); )
js.add(你要显示的JList)
js.setBounds(new Rectangle(100, 150, 189, 148));
listPanel.add(js);
你看这样行不行 是不是你想要的
这样 JScrollPane js = new JScrollPane (你要显示的JList);
要是不这样写的话 直接add 是不行的~~ 其他的不变~