如何设置可滚动列表的边界?
我将如何设置此列表的边界以使其不占用孔应用程序?我已经搜索了大约一个小时,但没有找到任何我想要的东西。
这是我所拥有的:
String alphabet[] = { "A", "B", "C", "D","E", "F", "G", "H","I","J","K",
"L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z" };
JList list = new JList(alphabet);
JScrollPane scrollPane = new JScrollPane(list);
Container contentPane = getContentPane();
contentPane.add(scrollPane);
我尝试了几种不同的方法,但均未成功。