JPopup menu trouble

I am developing an application that is requiring that a JPopup menu be triggered when the right mouse button is pressed and that a menu item selection occurr when the right mouse button is released.
This is simple enough and in a small test app I built, it worked fine - simply put the
myPopup.show(...)Line in the mousePressed method of my listener.
However, when I switch over to my Applet, this no longer works. The only way for selection to occurr is to right click and release before making my selection.
Has anyone else noticed this behavior and if so, is there a work around to provide the Applet similar behavior to the Application?
I can provide full code if I need to, but the only really applicable part is:
myPanel.addMouseListener( new MouseAdapter(){
   public void mouseReleased( MouseEvent e_ ){
      if( e_.isPopupTrigger() )
         myPopup.show( e_.getComponent(), e_.getX(), e_.getY() );
});All of the code is the same in the App/Applet and the behavior difference is described above.

It doesn't show when it's supposed to show. The mouse action and trigger action can all be captured. There is no error thrown.

Similar Messages

  • How to put a jpopup menue in a cell of jtable

    Hello,
    I want to make a jtable in which I want in one of the columns each cell when clicked(with right button) to pop up a jpopu menu with 3 actions. First I thought to make it with combobox but because I want to be activated with right button and then with the left i have changed my mind to jpopup menu.
    Can you tell me what kind of render and editor to use? I will be very grateful if you can send me some examples because I am new to the swing.
    Thanx,
    Miroslav

    You probably want to add a mouse listener to the JTable itself.
    There is some sample code below. It adjusts the location of the
    menu, and it's source component so that the menu can opperate
    on the proper object, rather than the source of the event.
    On your table add the menu as follows:
        table.addMouseListener(new PopupMouseListener(menu));You will have to decode the location to determine which column
    the "Right Click" occurred on. You may then have to decode the
    menu you want, (if you have different menus for different
    columns/cells).
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    import com.ovotron.util.Debug;
    public class PopupMouseListener extends MouseAdapter {
        private JPopupMenu menu    = null;
        private Component  invoker = null;
        public PopupMouseListener(JPopupMenu menu) {
            super();
            this.menu = menu;
        public PopupMouseListener(JPopupMenu menu, Component invoker) {
            this(menu);
            this.invoker = invoker;
        public void mousePressed(MouseEvent e) {
             int mod = e.getModifiers();
             if ((mod & MouseEvent.BUTTON3_MASK) == MouseEvent.BUTTON3_MASK) {
                 if (menu == null) {
                     return;
                 int       x     = e.getX();
                 int       y     = e.getY();
                 Component comp  = (Component)e.getSource();
                 if (invoker != null) {
                     // Event (X,Y), are relative to the source, need to
                     // re-calculate to be relative to the invoker.
                     Point src = comp.getLocationOnScreen();
                     Point loc = invoker.getLocationOnScreen();
                     x = x - (loc.x - src.x);
                     y = y - (loc.y - src.y);
                     comp = invoker;
                 menu.show(comp, x, y);
    }

  • JPopup menu can't be shown in linux 7.3

    I attach a jpopup menu to a textarea. It pops up properly in Windows environment. But it can't be shown in linux 7.3. Anyone knows why? Any work around for it? Thanks.

    It doesn't show when it's supposed to show. The mouse action and trigger action can all be captured. There is no error thrown.

  • How to add scrollbar to jpopup menu

    Hi everyone,
    Do u know how to add a scrollbar to jpopup menu ?

    Menus don't scroll, and shouldn't scroll. Given that, you shouldn't try and use JPopupMenu at all... rather, create your own component that implements the look and behavior you want. It will be far easier and less frustrating.
    Either that... or you should re-think what functionality you are trying to provide, and how you are trying to implement it. A scrolling menu just seems like a counterintuitive wacky UI design to me.

  • Dynamic JPopup Menu

    Can anybody help me in developing Dynamic JPopup Menu. I want to create a different pop-ups for different nodes of JTree.
    Any help in this regard is highly appreciable.
    Regards
    Raheel

    Well, you could store the name of a popup class with each node
    in the XML so that when you load the xml to generate the nodes
    you save off the popup class name and when you right click on
    a node you popup the node specific popup. That way you could add
    popup menus without having to change any code. The other way
    would be to look at the node when the user right clicks and create
    the popup dynamically based on the node. If you have many
    different popup configurations, loading them with the XML would
    probably be the easiest to maintain, assuming you have control
    over the XML.
    Have fun!
    Matt

  • Rollover Menu Trouble

    I'm a bit new to the whole rollover menu concept but I think
    I'm getting the hang of it. Now, on a website I'm designing for my
    own personal use, i have the main menu system in one movie clip. In
    that movie clip there are four other movie clips which contain the
    animation and scripting for the rollover parts. The rollover part
    works fine, when i roll my mouse over the movie clips they play an
    animation, and when i roll off they reverse the animation, but I'm
    having some difficulty linking the rollover buttons to play a
    certain frame in the timeline. for the first button that happened
    to be the "contact us" button, i used
    on(release){
    _root.play();
    I used "_root." because when i just put "play()" it would
    just play the interior timeline (i couldn't think of anything else
    to call it) of the movie clip. **Remember that i'm adding
    actionscript to movieclips inside one big movie clip**. And
    "_root.play()" worked fine. It played the set of "contact us"
    frames and i added another script to the end frame so it would
    redirect me back to the main menu. the second rollover movieclip
    ("games") however, is giving me much more trouble. i added the
    actionscript
    on(release){
    _root.gotoAndPlay(284);
    because theoretically, if the first one worked this one
    should work too. Except this is were it begins to get
    perplexing...whenever i publish or preview the movie to test the
    buttons, the first "contact us" button works fine, but when i get
    to the "games" button, instead of directing me to the 284th frame,
    it directed me to the 284th frame of a completely different scene.
    the scene where the intro to my site plays.
    So forgive me for the long message but help would be much
    appreciated. I've been working with flash in my spare time for a
    little under a year now I can't help to shake the feeling that the
    problem is something obvious.

    If you mean rollover rollvers (via layered menus) it could be the player itself, they are not supported acrosss all players.
    Layer menus are here Layered Menus
    Did you assign navigation to the buttons (or are yyou only going back and foorth between two buttons?)

  • Navigation Menu trouble!

    I created a drop down Navigation Menu in Dreamweaver CS5 by using the Spry Menu Bar. After I customized the colors I noticed that the drop down tab were appearing correct, but on the left if i widend the screen all the tabs were listed off the page.I have the website I created centered so u can see the tabs to the left.
    Attached is a picture.Can someone help me what did I do wrong?

    IMO the entire layout is in trouble not just the menu.
    I would start over with a pre-built CSS layout and ditch the tables.  You really don't need tables for layouts and should only use them when displaying tabular data (spread sheets & charts).
    CSS Liquid Header & Footer with Floats
    http://alt-web.com/TEMPLATES/I-page-with-floats.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Pop-up menu trouble!

    I am learning to create a website using dreamweaver, fireworks and photoshop. I created a sample website using these tools. Initially I created a layout in photoshop followed by web slices in fireworks. Later I exported my work in dreamweaver to complete the website. I saved my layout as a template so that any changes get updated automatically in all pages. To add a rollover image menu, pop-up/drop-down menu in template, I switched back to fireworks within dreamweaver. I created rollover image menu successfully and even drop-down too. It worked fine in fireworks preview window. I finished my editing in fireworks and switched back to dreamweaver and updated the changes in template. when I previewed that template, the rollover and pop-up menu  worked fine on all menu item(on mouse over). when i clicked a menu item/page /link, it follows to the page correctly and rollover worked still  fine and smooth but pop-up menu failed as if i never created one. I tried reloading the page but it failed.
    Again I loaded a preview from template and it worked. when I click any menu, it failed. But the rollover works well. I tried to repeat my steps from beginning and the result is the same.
    I tried for preview from individual pages, no pop-up emerged. Later I observed that pop-up javascript is located in all pages but never works on execution. It works only in the template from which I created all other pages but it still fails on clicking other links in same template preview. Please help me. This stopped me from moving to next lessons.

    Please elaborate
    which version of Dreamweaver
    the location of the lessons that you are following
    a copy of the code that you have created
    This will place us on the same footing and enable us to help you.

  • Menu bar not displaying inline with logo (Spry menu troubles - Extra Credit!)

    Coding Brothers and Sisters!
    Hope you all are well - would anyone please assist me to display inline the logo and menu bar at the following page?
         http://gratefulcreative.com/Andre_Madiz/index.html
    Superbonus, Adobe All-star points for help with my Spry Menu Bar, which is not showing submenus. I get an error message saying the following:
         This document contains Javascript code for a widget that no longer exists. If you don't remove the code, the browser might display Javascript errors when loading the page. Would you like Dreamweaver to find all the
         instances of the code for you?
         Widget: var Menu Bar 1 = New.Spry.Widget.MenuBar ("MenuBar1"; {imgdown:"SpryAssets/SpryMenuBarDownHover.gif",imgRight:"SpryAssets/SpryMenuBarRightHover .gif"});
    Thank you as always!
    Ken D
    Creative Director
    Grateful Creative
    www.gratefulcreative.com

    Use CSS floats.  Posted here with inline styles for expediency.  Ideally, you should set-up some re-usable classes for floats & clearing in your external style sheet.
    <div style="float:left; width:250px">
    <a href="http://www.andremadizmma.com"><img src="images/Bulldog_logo3.png" border="0"></a>
    </div>
    More on Floats:
    http://css.maxdesign.com.au/floatutorial/
    (='.'=)
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • IDVD menu troubles

    In iDVD when I preview my video the menu works fine, but when I play it in my DVD player on the tv it skips the menu completely and goes straight to the slideshow. How do I fix this?

    If you do see the grey box in the DVD map, get rid of it.
    It says something like "drag contents here to......"
    Delete it and make sure your menu is the very first screen on this map.
    I haven't used iDVD in a very long time, but had come across this as well and, if my memory doens' fool me this fixed it.

  • Horizontal drop down menu trouble

    Hello,
    I am trying to make a horizontal drop down menu which is
    located at the top of my page, right on top of an
    image.(www.citadelap.com/index_copy(2).htm). I have my code working
    in IE when it is on it's own page, without the image, etc.
    (www.citadelap.com/drop_menu.html). What do I have to do to get
    this drop down menu to show over the image in IE??
    Thanks for any help you can offer!!!

    I have quickly looked at your markup and found too many problems to discuss here. What I have found so far
    There is no DOCTYPE
    SpryMenuBarHorizontal is doubled up
    There is extensive use of absolute position where it is not neccessary
    I suggest you go to here http://www.w3schools.com/
    Gramps

  • CSS Menu Trouble!

    I have an existing menu built with css and now the client
    wants a drop down for one of the tabs.
    I have implemented the drop down but cannot get anything to
    work correctly. Any help would be great. I have attached the css
    for the sample page I am working on. If you hover over "services,
    you'll see that the hover state expands too wide and the drop down
    doesn't line up with the bottom of the navbar.
    Here's the url to that page:
    test
    page

    I found the mistakes...
    Victoria
    "Victoria" <[email protected]> wrote in message
    news:ejqdl6$cl$[email protected]..
    > Hello everyone,
    > I have created a SwapClass CSS Tree Menu using
    navigation tutorials from
    > Project VII for this site www.ketchum.ca . In IE6 I see
    gaps after 1, 2
    > and 5th "buttons". There are also lots of random gaps in
    submenus.
    >
    > I am not sure what is causing this and I have to get rid
    of the gaps as
    > soon as possible. When I preview the site in Firefox or
    even IE5.2 on Mac
    > everything looks perfect.
    >
    > I would be very grateful for any advice as to how to fix
    this problem.
    >
    > Victoria
    >

  • Dynamic Flash Menu Trouble

    I have spent way too long building a dynamic drop-down Flash
    menu. Now it is time to publish but if I use wmode to remove the bg
    my mouse events get all screwed up, plus from what I have read on
    the forums I really don't want to use wmode if I can help it. Is
    there any workaround here? The menu works great with the default
    background covering up half of my web page but this is not a
    workable solution from a design standpoint.
    I am really hoping I did not just waste sooooo much time. Any
    help is greatly appreciated.

    Hi Speedee, I found this post that explains a floating flash
    nav:
    http://www.merhl.com/webdevblog/index.php?itemid=8&catid=3
    Here is a sample of the nav idea:
    http://www.merhl.com/samples/floatFlash.htm
    The idea is to nest the embedding swf file into two divs.
    Then give it a z-index. At the bottom of the page that explains it
    at merhl.com is a script to put it onto a different z-index. This
    may help.
    I'm trying to build a flash menu that is populated with an
    external xml file. I used the menuBar component. In doing so I am
    looking for a way to use a 'Rollout' event like your menu rather
    then the user having to click to hide the menu. Any ideas?
    Peace and Good Luck.

  • Drop down menu trouble

    I am trying to fix a slight problem with our company website.
    The drop down menu along the top will not work in IE, but it does
    work in Firefox. The url is www.citadelap.com. What do I need to
    change in order for this to work?

    That solution is like putting bandaids on a surgical
    incision. I certainly
    wouldn't bother with it consdering that you will still have a
    dog of a menu
    that is not spiderable and not accessable.
    It would be much better to use a good, best-practice menu
    approach -
    Check the uberlink and MacFly tutorials at PVII -
    http://www.projectseven.com/
    and the Navbar tutorial/articles at Thierry's place
    http://tjkdesign.com/articles/dropdown/
    Or this one (more recent article):
    http://tjkdesign.com/articles/Pure_CSS_Dropdown_Menus.asp
    Or to get it done fast, go here -
    http://www.projectseven.com/tutorials/navigation/auto_hide/index.htm
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Vaio Boy" <[email protected]> wrote in
    message
    news:f9q60e$q1g$[email protected]..
    > Stephanie,
    >
    > There is a known problem with Dreamweaver menu's - they
    don't work! Try
    > this
    > website for a solution to your problem - it saves me
    typing it out.
    >
    >
    >
    http://paynah.wordpress.com/2007/06/17/dreamweaver-menusa-solution-and-then-some
    > /
    >
    > Hope this helps...
    >

  • Encore Menu Trouble

    I'm making a custom menu for my DVD in Photoshop, using the film/video preset (720x480 I believe). When I import the image to encore, everything looks good. Once I've burned the disc and put it in my DVD player the image looks stretched, as do the video buttons I used.
    Any ideas as to what the problem could be?

    Before trying to create a menu from scratch in Photoshop, it helps to learn by starting with one from the Encore library and modify it in Photoshop. Add a menu from the Encore library to an Encore project, then right click and pick "edit in Photoshop." When you realize how easy it is, there's no need to start from scratch. You can change everything you want to change before you can learn the small subtleties that created your problem.
    In any event, as John says, PAR is the partner of the pixel size. But you have a choice to make: widescreen or standard? You don't say which you picked, so I assume you simply got it wrong. The Film & Video presets in Photoshop have a group of Pixel Aspect ratios at the bottom. The 720x480 you indicate is NTSC, so you pick between D1/DV (par .91) or widescreen (1.21).
    It is possible you did it right, and Encore is interpreting it wrong, which you can fix, either way, by telling Encore which is correct. Since your menu looks stretched (rather than squished), you probably used widescreen when you wanted standard.
    Try changing in Encore by looking at what Encore is seeing as the display ratio: 4:3 or 16:9. Select the menu in Encore (select the menu only,not a button), and look at the properties panel, basic tab. If is set as 4:3, change it to 16:9.

Maybe you are looking for

  • Sort images in slideshow

    I spent the weekend scanning about 120 photos to make a DVD to run during my wife's 50th birthday part, naming them all by year and number within the year so they would be nicely sorted for the slideshow. Much to my disgust when I dragged them into t

  • Removing small objects in drawing

    Hello, I have a quastion regarding the removal of small objects in a drawing. I made with ArcGIS a map of the Netherlands. Because it is a detailed map, it also becomes heavy and my computer slows down. I merged some smll elements together with the p

  • New Photo Booth effects??

    I installed Leopard earlier on today (Family license) on both my iMac and my MacBook. I thought both installations had gone perfectly smoothly, but it transpires that the new effects in Photo Booth haven't been installed on my iMac! =( They've been i

  • Duplicate email accounts?

    I switched back to tbird after an unhappy stint with a different email client. My web host (host gator) helped set up things so emails do not load onto my PC. I understand this means the "local" files and directory are not in use and that's great. I

  • Some questions while using JMF play mpeg-1 stream media?

    I use Helix server to provide unicast, and use JMF to play the stream media. But the JMF only play the audio stream transferred by rtp. I have used video palyer�s getVisualComponent() method to get Visual component and added it into the frame. But I