Put new component on JXTaskPane
Asked Answered
M

1

14

The JXTaskPane used in Java Swing has a title bar. There is a expand/shrink button in it. I would like to be able to add my own actions in the titlebar that would appear beside the expand/shrink button.

How can I do this? I try myself many times, but do not get the expected result. I made a new JButton and set its location over the title bar coordinates, but it's added in the element.

I have attached a screenshot that shows a help type action in the title bar to show you what I mean.

Tasks image

Michey answered 14/12, 2011 at 4:3 Comment(1)
not supported, you'll have to implement it yourself. For starters, have a look at BasicTaskPaneUI - it paints and wires the toggle button (inside the border that paints the title). Alternatively, you might try to start from a JXTitledPane (which supports arbitrary components in the title area) and make that collapsible. Anyway, interesting requirement, you might consider to file an enhancement issue in the SwingX issue tracker :-)Repertory
F
1

That's not possible. I'd recommend perhaps making a new JFrame pop up when you click the button to extend the dropdown menu. Creating your own JFrame popup would also afford you more creativity and customizability when it comes to the components you can put on it. I've not much experienced with this sort of thing, but you could try to do this. It might not be ideal though.

Fawcette answered 16/7, 2015 at 11:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.