swing - change popup height -
i have java swing popupmenu couple of menuitems.
is there way increase size of popup keeping same number of menuitems? example, add 10px before 1st menuitem , 10px after last menuitem.
how can this? can give me hint?
thanks
this pretty simple. since jpopupmenu
container
following code produce effect desire
jpanel p1 = new jpanel(); p1.setpreferredsize( new dimension(100,10)); jpanel p2 = new jpanel(); p2.setpreferredsize( new dimension(100,10)); menu.add(p1); menu.add(new jmenuitem("item 1")); menu.add(new jmenuitem("item 2")); menu.add(new jmenuitem("item 3")); menu.add(p2);
Comments
Post a Comment