Rushii
asked on
Display JPanel on top of MapBean. (arcobjects)
I am working on creating a GUI that has a map and some menues in the form of buttons. This needs to be done in java and the map will be displayed in Esri arcobject MapBean control and the menues need to be overlaying the map so the map extends behind the menue pallete.The tricky part is obviously making menu pallete overlay the MapBean. I have attempted to tackle the problem using JLayeredPane but even though I set map panel index lower than menu index the map appears on top of menu taking up all the space in the window.
Here is relevant code:
MapBean mapBean=Map.getMapBean() //custom function to get map bean
JPanel pnlForMap=new JPanel();
pnlForMap.setLayout(new BorderLayout());
pnlForMap.setBounds(0,36,1 280,768);
pnlForMap.add(mapBean, Borderlayout.CENTER);
PnlMainBtns pnlMainBtns=new PnlMainBtns(); // class extends JPanel
pnlMainBtns.setBounds(1035 ,36,235,97 8);
JLayeredPane lydpane=new JLayeredPane();
lydpane.setBounds(0,0,1280 ,768);
lydpane.add(pnlForMap, new Integer(0));
lydpane.add(pnlMainBtns, new Integer(1));
application.getContentpane ().add(lyd pane);
MapBean is of type JComponent but since whole java arcobject thing is a wrapper around COM/C++ there are probably nuances I don't know about.
Any ideas?
Here is relevant code:
MapBean mapBean=Map.getMapBean() //custom function to get map bean
JPanel pnlForMap=new JPanel();
pnlForMap.setLayout(new BorderLayout());
pnlForMap.setBounds(0,36,1
pnlForMap.add(mapBean, Borderlayout.CENTER);
PnlMainBtns pnlMainBtns=new PnlMainBtns(); // class extends JPanel
pnlMainBtns.setBounds(1035
JLayeredPane lydpane=new JLayeredPane();
lydpane.setBounds(0,0,1280
lydpane.add(pnlForMap, new Integer(0));
lydpane.add(pnlMainBtns, new Integer(1));
application.getContentpane
MapBean is of type JComponent but since whole java arcobject thing is a wrapper around COM/C++ there are probably nuances I don't know about.
Any ideas?
check these interesting links
http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualHelp/engine/index.html#//00010000034v000000
http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/index.html#//000100000355000000
http://edndoc.esri.com/arcobjects/9.2/java/api/arcobjects/com/esri/arcgis/beans/map/MapBean.html
http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualHelp/engine/index.html#//00010000034v000000
http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/index.html#//000100000355000000
http://edndoc.esri.com/arcobjects/9.2/java/api/arcobjects/com/esri/arcgis/beans/map/MapBean.html
ASKER
Thanks for responce gudii9 but I already saw those links.
for_yan good article but I guess I need someone to give an advice how to mix MapBean specifically and make other components appear on top of it, my application draws correctly if I use a JButton instead of MapBean, JButton appears behind the menu panel and MapBean does not. Why? How to fix that?
for_yan good article but I guess I need someone to give an advice how to mix MapBean specifically and make other components appear on top of it, my application draws correctly if I use a JButton instead of MapBean, JButton appears behind the menu panel and MapBean does not. Why? How to fix that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I actually had such thought, but looked at the API page and it says it extends JComponent - yes, I was misled, actually I forgot - it can extend JComponet but be AWT, it is true
ASKER
Explained my problem.
http://stackoverflow.com/questions/852631/java-swing-how-to-show-a-panel-on-top-of-another-panel