Originally Posted by
Shatterhand
Applet and Canvas were AWT, heavy weight, and Swing is light weight, mixing these werent that good. This line solved it:
menu.getPopupMenu().setLightWeightPopupEnabled(fal se);
If you ever decide to use JavaFX then you can position the menu-bar and applet like so:
Java Code:
void initJFX
(String world,
int width,
int height
) throws IOException { //... //... root.
getChildrenUnmodifiable().
stream().
filter(n
-> n.
getId().
equals("menuToolBarPanel")).
forEach(n
-> { int menuWidth
= (int)n.
getBoundsInParent().
getMinX() + (int)n.
getBoundsInParent().
getWidth(); int menuHeight
= (int)n.
getBoundsInParent().
getMinY() + (int)n.
getBoundsInParent().
getHeight(); ClientApplet applet
= new ClientApplet
(world, width, height
); panel.
setPreferredSize(new Dimension(menuWidth, menuHeight
)); frame.
add(applet,
BorderLayout.
CENTER); applet.
start(); //... //... }); }
That would position the applet below the menu above the applet. You can't embed the RS applet in a swing-node. It just doesn't work so the above was the only solution I could come up with OTHER than messing with the properties and weights.