问题
While I was reading Oracle Swing documentation, I came across this example of a set of components displaying the Nimbus Look and Feel named SwingSet3
. I'm new to Swing. Can someone tell me if the accordion in the sidebar is a Swing component or not?
回答1:
It is not a standard swing component.
You can have a look at the source code for the SwingSet3 demo here. The component on the left is a composite component made out of various other components such as JPanel
, JLabel
and JButton
. There is a custom com.sun.swingset3.utilities.CollapsiblePanel too.
回答2:
A similar component is the JXTaskPane/-Container which is part of SwingX You can have a look at a demo inspired by SwingSet3.
Note that SwingX is actively maintained, its current release 1.6.3 available at maven.java.net
来源:https://stackoverflow.com/questions/10030002/java-swing-accordion-in-nimbus-look-and-feel