ComboBoxAction problem

Hello,
I'm using class ComboBoxAction to create a ComboBox in my program.
And I've initialized my actionGroup properly. actionGroup is a DefaultActionGroup.
ComboBoxAction comboAction = new ComboBoxAction() {
protected DefaultActionGroup createPopupActionGroup(JComponent button) {
return actionGroup;
}
In fact I receive one button with a list of availble choices. That's all good, but how can I get the real comboBox (I mean when you have a button and a text field for showing the results, as we have in JComboBox for e.g.).
So, I wonder maybe there is some method in ComboBoxAction that has to be overridden to change the presentation?

1 comment
Comment actions Permalink

Hello ALincoln,

I'm using class ComboBoxAction to create a ComboBox in my program.
And I've initialized my actionGroup properly. actionGroup is a
DefaultActionGroup.
ComboBoxAction comboAction = new ComboBoxAction() {
protected DefaultActionGroup
createPopupActionGroup(JComponent button) {
return actionGroup;
}
In fact I receive one button with a list of availble choices. That's
all good, but how can I get the real comboBox (I mean when you have a
button and a text field for showing the results, as we have in
JComboBox for e.g.).
So, I wonder maybe there is some method in ComboBoxAction that has to
be overridden to change the presentation?


If you want to have a real JComboBox as the action presentation, you shouldn't
use ComboBoxAction at all - instead, you should use CustomComponentAction
and provide your own implementation of createCustomComponent().

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.