Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在面板内有一个滚动面板,而滚动面板覆盖整个面板。我怎样才能做到这一点?
确保 JPanel 具有 BorderLayout,然后将 JScrollPane 添加到 BorderLayout.CENTER 约束。当然,不要在 NORTH/E/W/S 约束中添加任何其他内容。