Re: JMenu holding JButton instances - bug with 5.0?



On 4/29/2005 at 3:01:32 AM, allen@xxxxxxxxxxxxxxxxx wrote:

> I resorted to using JMenuItems for the JButtons, with a bit of
> tweaking they can look better.

Indeed. JMenuItem, JCheckBoxMenuItem and JRadioButtonMenuItem do pretty
much the same thing as JButtons, JCheckBoxes, and JRadioButtons, but they
are intended to be used in a menu. So I think they make a much better
starting point. You can always customize them to get the effect that you
want.

> However this discussion makes me amazed that some of my other
> code ever worked to start off with. I've embedded a JTable (in a
> scrollpane) using JCheckBox cell-renderers/editors into a JPopupMenu,
> and based on your description here, I'm amazed that it worked.

Did you place the table in a menu connected to a JMenuBar, or in a plain
JPopupMenu? I am not sure why they are different, but as you have seen,
they are.

--
Regards,

John McGrath
.