可滚动复选框

发布于 2024-11-20 00:37:05 字数 111 浏览 5 评论 0原文

我需要制作一个可以包含未知数量元素的滚动框。即它需要能够滚动。我不太确定该怎么做。请帮忙。在此处输入图像描述

I need to make a scroll box that can contain an unknown number of elements. Namely it needs to be able to scroll. I'm not quite sure how to do this. Please help.enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

于我来说 2024-11-27 00:37:06

使用 JScrollPane,其中包含 JPanel。这样,您就可以使用 JScrollPane 将任意数量的元素添加到 JPanel,而不会超过面板的物理大小。

以下是非常著名的 Oracle 教程的一部分,其中解释了 JScrollPane 元素:
http://download.oracle.com/javase/tutorial/uiswing/components /scrollpane.html

我希望这有帮助!

Use a JScrollPane with a JPanel wraped inside it. That way, you can add any number of elements to the JPanel without exceeding the panel's physical size using the JScrollPane.

Here is one part of the very famous oracle tutorial that explains the JScrollPane element:
http://download.oracle.com/javase/tutorial/uiswing/components/scrollpane.html

I hope this helps!

七婞 2024-11-27 00:37:06

您想要将 JList 与自定义渲染器一起使用。

这是一个类似的问题。

You want to use a JList with a custom renderer.

Here's a similar question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文