Re: [OpenMap Users] add JButton in a layer

From: Christopher Franklin <christopher.franklin_at_lmco.com>
Date: Wed, 24 Sep 2008 13:03:02 -0400

Ruben,

Someone can correct me if I am wrong but I don't think it is possible to
embed Swing objects inside the Openmap bean. I do know for a fact that
you can embed the openmap bean into a Swing container along with your
button and link the functionality but it sounds like you really want the
button as part of the map itself. If this is the case the only way I can
think of to do this is to create an image to represent your button and
to place this image into a layer as an OMGraphic. You can then hook in a
mouse listener to the OMGraphic and interpret the clicks as you see fit.
I hope one of these two solutions will work for you!

Chris

Ruben DF wrote:
> Hi,
>
> How can I add a Jbutton in the layer? I tried with this unsuccessfully
> (JButton does not appear in the layer)
>
> JButton jb = new JButton("hello");
> jb.setLocation(100,100);
> myLayer.add(jb);
>
> I also tried passing the Jbutton in OMGraphicList.add(JButton) but it
> is not correct because add is expecting a OMGraphic...
>
> Is there any way to convert JButton to OMGraphic?
>
> Thanks in advance
> Best regards
>
>



--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Sep 24 2008 - 13:06:41 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT