开发者

Using visual swing JPopup menu in netbeans

i want to add a popup menu to my app but when i add it to my panel i see its disappear. how i can edit jpopup menu visu开发者_如何学编程aly like other menus?


I think you're talking about using the matisse visual designer in NetBeans.

In which case the process is slightly different from creating menubar menus that you can just drag onto the screen.

The steps to get this to work are as follows

  1. Drag a pop up menu on to the screen
  2. Go to the Inspector Window (Window -> Navigating -> Inspector)
  3. You will see an element there - jPopupMenu1
  4. Right click jPopupMenu1 -> Add from Palette
  5. This submenu will show you all the items that can be added to your pop-up menu

After you have selected the item you will see it listed as a child node of jPopupMenu1.

To change the order of your menu items, select an item, right click and select move up or move down.

Don't forget that although you've added the pop-up menu to the form you still need to register the pop-up menu with the component that you want it to activate for, the easiest way to do so is via SetComponentPopupMenu().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜