Hello,
I have a JPanel with many option to personlize the settings. Since it is too much to start with for the user, I would like to collapse the view and than open it with plus/arrow so the full menue is available. Please let me know if/how I need to transfer may be the JPanel into something else.
Thanks for you help.
Knut Nilson wrote:Hello,
I have a JPanel with many option to personlize the settings. Since it is too much to start with for the user, I would like to ...
Have you considered using a JTabbedPane? a tabbed pane is a fairly standard programming idiom for multiple settings.
Sounds like an expander. At least, that's what GTK+ calls it. That's not hard to implement; I've done it myself a while ago already.
The setup is pretty basic. You have a main panel with a BorderLayout. At the top you have your controller panel, with the expand / collapse button and its label. In the center you have the main component, mostly a JPanel. Expanding means showing the main component (setVisible(true)), collapsing means hiding it (setVisible(false)).
I am working on it, but what I struggle with is to put the CheckBox in the TiledBorder. This is what I have, do you have an additional hint:
To: Darryl Burke
Tabbed Pane is not applicable for this scenario, since I need to be able to show options in one view. But thanks for the hint, if I don't find anything else I now have a plan B
You can't use borders that require interaction. Or at least it will be quite tricky. The reason is that a border is "eye candy" - it only determines how it's painted, nothing more. Like I said in my previous post (in other words), using a BorderLayout with a component at BorderLayout.NORTH would be a lot easier.
Knut Nilson wrote:To: Darryl Burke
Tabbed Pane is not applicable for this scenario, since I need to be able to show options in one view. But thanks for the hint, if I don't find anything else I now have a plan B
You're welcome.
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, that will fit in a stocking