PopupMenus on Buttons


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: PopupMenus on Buttons

  1. #1
    Join Date
    Jan 2005
    Posts
    5

    PopupMenus on Buttons

    Quick question. I have 4 buttons in an application, and I want one of the buttons when clicked to bring up a popupmenu. My question is that is it possible to add a JPopupMenu with a JButton. I'm assuming you can add popupmenus on virtually any component, or maybe not...

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    I don't see why not. You could just add it to your main panel and show the menu when the user clicks the button via the actionPerformed(ActionEvent e) method in the Listener.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center