Mouse Right-Click menu with JTextField and swing

Hello,
I created a small app for providing an organized gui to insert data and log it to a text file. I just recently converted it to swing to improve the functionality of it and try to get away from some of the bugs I found in using regular java.awt.
So far so good, all of my complaints with regular awt are gone using swing, but I have one problem I see as a real pain.
With a TextField in java.awt you can right click and get the standard mouse-menu. The mouse menu is nice for cut/copy/paste type operations and I do not want to lose this functionality.
But with swing and JTextField I am not getting the menu. I right click in there and get nothing. My UIManager is loading the OS one (windows) and I cannot find a way to recover this feature.
Does anyone know how I can get this working?
Thanks,
Lucas

Well as I posted here to try and see if there was a way to recover what the OS already provides I have struggled through creating a popup menu.
I have the cut, copy, paste and selectall complete but I am struggling with the undo option.

Similar Messages

  • Cant see MOUSE RIGHT CLICK menu

    WINDOWS 7 cant see MOUSE RIGHT CLICK menu -WHEN i right click menu is BLANK - sometimes if i goto up or down arrow it appeares then dissapears befor i can select it

    This is probably due to a problem with an add-on. Follow the procedure in the [[troubleshooting extensions and themes]] article to identify the culprit.

  • MOUSE, RIGHT CLICK MENU

    Where and how in the hst.template library do you turn this option off?

    Michel,
    It's not in the libraries, I'm afraid. In the Object Library there's a 'Popup Menu' called QMS$ITEM_POPUP, and through the object CGSO$DEFAULT_ITEM, where the property 'Popup Menu' is set to this QMS$ITEM_POPUP, all generated items will have this property set as well. You will have to customize the object library and clear the property on CGSO$DEFAULT_ITEM (or delete the popup menu altogether).
    Kind regards,
    Peter
    null

  • Question about right click menu

    i want to add a right click event and pop up a menu on the row of "table control"
    dose the "web dynpro project" can do that or i must use "portal application project".

    Hi Charles,
    This requirement is Not possible with Web Dynpro.
    SAP has still not come up, with any APIs to change or edit the right click menu.
    Thanks and regards,
    Sam

  • Simple Right-click menu in Text Area

    How can I simply implement a right-click menu with
    the options copy-paste on a text area or editor pane?
    I believe there must be ready code for sth like that.

        protected void createPopupMenu ()
            mMenu = new JPopupMenu ();
            cutOption = mMenu.add(new JMenuItem("Cut"));
            cutOption .addActionListener ( new ActionListener ()
                public void actionPerformed ( ActionEvent e )
                   //do cut here
            copyOption = mMenu.add(new JMenuItem("Copy"));
            copyOption .addActionListener ( new ActionListener ()
                public void actionPerformed ( ActionEvent e )
                   //do copy here
            pasteOption = mMenu.add(new JMenuItem("Paste"));
            pasteOption .addActionListener ( new ActionListener ()
                public void actionPerformed ( ActionEvent e )
                   //do paste here
            });when you instantiate your textarea or editpane add this line:
            createPopupMenu (); //popup menu for right clickshould work perfectly

  • Left clicking mouse acts as if I'm right clicking, and comes up with right click menu?

    Hi I was wondering whether anyone could help me with this, I've had this problem for a week or so now and it's beginning to get frustrating.
    I have a newish iMac, bought in January, and I've been having this problem the last week or so, where when I left click something, it acts as if I am right clicking it and it comes up with the right click menu. I has happened mostly while on the internet (chrome), but also when I'm just on my desktop, but less often.
    It only happens every so often, and rights itself after a couple of minutes. What could be causing this, and how do I stop it?
    This is my first ever post on here, so I do apologise if I have been vague or I have posted this question in the wrong section, I am also new to macs (well since January).
    The mouse I am using is a dell wired mouse, a couple of years old, which I just plugged in without the need of installing software etc.
    Many thanks for any help in advance.

    Hello & welcome!
    No worries, you did great for a 1st post, & this is generally a friendly place.
    It sounds light it's the Mouse button from here, to test it...
    Go to System Preferences > Mouse, change the Primary button to the Right button... does the Right button ever do that now as the left button?

  • Lost start menu icons and not listed in right click open with option +more.

    Weird. I need help. Quicktime 7.3.0.70 only--Start menu lost it's icons in the quicktime folder. When right clicking video files, the "open with" option no longer displays quicktime as a program. And lastly, open an avi file or even mpg and the program stops responding without even getting to play the file. I've uninstalled and reinstalled multiple times but can't seem to fix these issues. Can anyone help? Thanks. This just seemed to happen out of the blue.
    Message was edited by: sallem

    I also have lost the icons for Quicktime in my start menu under Windows XP. The icons actually work when you do click them but the icons are not loaded. Everything functions fine and it's the newest version of Quicktime installed. I also have the newest version of iTunes installed. I ended up manually adding my own icons on the start menu as I've uninstalled and reinstalled Quicktime several times to no avail and even attempted to flush the windows icon cache. No go. This just started happening recently.
    It's not happening on my WinXP Pro laptop however, although I've yet to upgrade to the latest version of iTunes+Quicktime.
    *Right-Click Open With Menu still functions properly and the icon image is appearing correctly in that menu.
    Message was edited by: ZenFool

  • Copying a table with the right-click menu in schema browser fails to copy comments when string has single quote(s) (ascii chr(39))

    Hi,
    I'm running 32-bit version of SQL Developer v. 3.2.20.09 build 09.87, and I used the built in context menu (right-clicking from the schema browser) today to copy a table.  However, none of the comments copied.  When I dug into the PL/SQL that the menu-item is using, I realized that it fails because it doesn't handle single quotes within the comment string.
    For example, I have a table named WE_ENROLL_SNAPSHOT that I wanted to copy as WE_ENROLL_SNAPSHOT_V1 (within same schema name)
    1. I right-clicked on the object in the schema browser and selected Table > Copy...
    2. In the pop-up Copy window, I entered the new table name "WE_ENROLL_SNAPSHOT_V1" and ticked the box for "Include Data" option.  -- The PL/SQL that the menu-command is using is in the "SQL" tab of this window.  This is what I extracted later for testing the issue after the comments did not copy.
    Result: Table and data copied as-expected, but no column or table comments existed.
    I examined the PL/SQL block that the pop-up window issued, and saw this:
    declare
      l_sql varchar2(32767);
      c_tab_comment varchar2(32767);
      procedure run(p_sql varchar2) as
      begin
         execute immediate p_sql;
      end;
    begin
    run('create table "BI_ETL".WE_ENROLL_SNAPSHOT_V1 as select * from "BI_ETL"."WE_ENROLL_SNAPSHOT" where '||11||' = 11');
    select comments into c_tab_comment from sys.all_TAB_comments where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT' and comments is not null;
    run('comment on table BI_ETL.WE_ENROLL_SNAPSHOT_V1 is '||''''||c_tab_comment||'''');
    for tc in (select column_name from sys.all_tab_cols where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT')
        loop
       for c in (select comments from sys.all_col_comments where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT' and column_name=tc.column_name)
       loop
       run ('comment on column BI_ETL.WE_ENROLL_SNAPSHOT_V1.'||tc.column_name||' is '||''''||c.comments||'''');
    end loop;
    end loop;
    EXCEPTION
      WHEN OTHERS THEN NULL;
    end;
    The string of the table comment on WE_ENROLL_SNAPSHOT is this:
    WBIG table of frozen, point-in-time snapshots of Enrolled Students by Category/term/pidm. "Category" is historically, and commonly, our CENSUS snapshot; but, can also describe other frequencies, or categorizations, such as: End-of-Term (EOT), etc. Note: Prior to this table existing, Census-snapshots were stored in SATURN.SNAPREG_ALL. All FALL and SPRING term records prior-to-and-including Spring 2013 ('201230') have been migrated into this table -- EXCEPT a few select prior to Fall 2004 (200410) records where there are duplicates on term/pidm. NO Summer snapshots existed in SNAPREG_ALL, but were queried and stored retroactively (including terms prior to Spring 2013) for the purpose of future on-going year-over-year analysis and comparison.
    Note the single quotes in the comment: ... ('201230')
    So, in the above PL/SQL line 11 grabs this string into "c_tab_comment", but then line 12 fails because of the single quotes.  It doesn't know how to end the string because the single quotes in the string are not "escaped", and this messes up the concatenation on line 12.  (So, then no other column comments are created either because the block throws an error, and goes to line 22 for the exception and exits.)
    When I modify the above PL/SQL as my own anonymous block like this, it is successful:
    declare
      c_tab_comment VARCHAR2(32767);
    begin
    SELECT REPLACE(comments,chr(39),chr(39)||chr(39)) INTO c_tab_comment FROM sys.all_TAB_comments WHERE owner = 'BI_ETL'   AND table_name = 'WE_ENROLL_SNAPSHOT'  AND comments IS NOT NULL;
    EXECUTE IMMEDIATE 'comment on table BI_ETL.WE_ENROLL_SNAPSHOT_V1 is '''||c_tab_comment||'''';
    for tc in (select column_name from sys.all_tab_cols where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT')
        loop
       for c in (select REPLACE(comments,chr(39),chr(39)||chr(39)) comments from sys.all_col_comments where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT' and column_name=tc.column_name)
       loop
       EXECUTE IMMEDIATE 'comment on column BI_ETL.WE_ENROLL_SNAPSHOT_V1.'||tc.column_name||' is '||''''||c.comments||'''';
    end loop;
    end loop;
    EXCEPTION
      WHEN OTHERS THEN NULL;
    end;
    On lines 4 and 8 I wrapped the "comments" from sys.all_tab_comments and sys.all_col_comments with a replace command finding every chr(39) and replacing with chr(39)||chr(39). (On line 8 I also had to alias the wrapped column as "comments" so line 10 would succeed.)
    Is this an issue with SQL Developer? Is there any chance that the menu-items can handle single quotes in comment strings? ... And, of course this makes me wonder which other context menu commands in the tool might have a similar issue.
    Thoughts?
    thanks//jacob

    PaigeT wrote:
    I know about quick drop, but it isn't helpful here. I want to be able to right click on a string or array wire, navigate to the string or array palette, and select the corresponding "Empty?" comparator. In this case, since I do actually know where those functions live, and I'm already using my mouse to right click on the wire, typing ctrl-space to open quick drop and then typing in the function name is actually more work than navigating to it in the palette. It would just be nice to have it on hand in the location I naturally go to look for it the first time. 
    I don't agree with this work flow.  Right hand on mouse, left hand on home keys.  Pressing CTRL + Space is done with the left hands, and then you could assign "ea" to "Empty Array" both of which is accessible with the left hand.  Darren posted a bunch of great shortcuts for the right handed developer.
    https://decibel.ni.com/content/docs/DOC-20453
    This is much faster than waiting for any right click menu navigation, even if it is found in the suggested subpalette.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Cannot not click on menu that appears when i right click my taskbar, as the right click menu dissapears when i move mouse over to the right click menu

    PROBLEM: RIGHT CLICK CONTEXT MENU DISAPPEARS WHEN TRYING TO LEFT CLICK AN OPTION
    Hi,
    Im using Windows 7, and i could always
    go down to my TaskBar and Right Click
    Icons, and active icons, which would bring up
    the standard Right Click Menu list.
    PROBLEM
    As soon as i moved my Mouse away from
    the bottom Window 7 Task Bar to go a couple
    of millimeters above to left click an option on
    the Context Menu i opened with my right click,
    The whole Menu disappears, and this happens in
    Firefox version 29.01, other programs in Firefox,
    and other such as Skype.
    When i was running Firefox 28
    i didn't have this problem, can you help me out.
    Thank You
    Kev Borg

    '''PROBLEM'''
    '''RIGHT CLICK MENU DISAPPEARS WHEN YOU MOVE YOUR MOUSE TO LEFT CLICK A MENU OPTION ON THE RIGHT CLICKED MENU.'''
    ''''''YOU CAN'T BECAUSE AS YOU MOVE YOUR MOUSE TO THE MENU YOU JUST RIGHT CLICKED TO OPEN DISAPPEARS BEFORE YOU GET A CHANCE TO LEFT CLICK YOUR CHOICE.''''''
    '''SOLUTION'''
    '''1]''' GO TO '''CONTROL PANEL''' AND CLICK TO VIEW MENU
    '''2] ''' GO TO "'''EASE OF ACCESS CENTRE'''" AT THE TOP.
    '''3]''' LEFT CLICK ON MENU ITEM "'''EASE OF ACCESS CENTRE'''"
    '''4]''' AFTER YOU LEFT CLICK ON "'''EASE OF ACCESS CENTER'''" IT APPEARS.
    '''5]''' LOOK DOWN THE LIST TILL YOU FIND "'''MAKE THE MOUSE EASIER TO USE'''"
    '''5]''' THE TOP SECTION SHOWS YOU HOW TO CHANGE YOUR MOUSE COLOURS ETC.
    '''6]''' SCROLL DOWN TILL YOU SEE THIS HEADING "'''MAKE IT EASIER TO MANAGE WINDOWS'''"
    '''7]''' RIGHT UNDER THAT MENU THERE IS CHECK BOX,
    "'''ACTIVATE A WINDOW BY HOVERING OVER IT WITH YOUR MOUSE"
    '''8] MAKE SURE THERE IS NOT A TICK IN THAT OPTION BOX, IF THERE IS UN TICK IT AND APPLY AND CLICK OK TO SAVE.
    And now you should have No More Problems with your Right Click Menu disappearing when you move your mouse over to the menu to left click a menu item on that right clicked menu.
    SOLUTION FIXES PROBLEM.
    Thank You and i hope this answer my help any other people who have had this frustrating problem.
    cheers KiwiKev

  • Custom Right-Click Options with Mighty Mouse (scroll-wheel)

    Is there a way to add custom actions to the contextual right-click menu on the mighty mouse? Or a program that will allow me to do that? I am looking to add a script or other items to the right-click menu options.

    this has nothing to do with the kind of mouse you are using. you can add items to the right-click menu by creating a service. you can make your own using automator.
    also, some applications install services when you install the applications and there are a number of built in services available. you can check system preferences->keyboard->keyboard shortcuts->services and activate the ones you want.

  • Need to create menu on mouse right click

    I have a web application with frames with one frame have a tree.
    Now i want to right click on one node and say "Copy" the node to another location in the tree..
    My problem is that i am able to get how to create the menu option on right click.
    Can anybody suggest how to acheive this

    i'm pursuing the same thing. i believe ONE way of doing it is to add an ActionListener to the component, whether it be the frame or the node component you speak of. compare the action event object to the right click of the mouse, if it's true the trigger a menu, and ideally place the menu object next to the x,y coordinates of the mouse cursor (either to the left or to the right depending on where on the screen the cursor is.
    as far as how a menu is created i do not really know and would also like some information on that.
    i'm guessing it should be related to the JMenu object (directly a subclass of JMenuItem which in turn is a subclass of AbstractButton). That's a good place to start from. let me know if you get anywhere on this.
    -William

  • Why keyboard and mouse right click not working in Solaris and Linux?

    Hi all,
    I have two problems:
    1) I am working on AWT/Swing application and its working fine in window enviornment,but while running on solaris and linux mouse right-click option window not poping up.
    2) Ctrl+c,Ctrl+v,Home and End keyboard key are not working in solaris and linux OS for same application.
    Pls provide me some solution for these problem.
    -Dinesh

    Hi Nik,
    Thanks for reply. I found some solution for the above problem.
    For mouse right click there was problem in my source code.I have not implemented the mousePressed() method
    In case of keyboard Home, End and arrow key working fine after exporting AWTUSE_TYPE4_PATCH=false; in solaris and linux
    But still Ctrl-c and Ctrl-v not working.
    I am using JDK1.5.0_07+Eclipse IDE 3.1
    -Dinesh

  • I'm frustrated with the bookmarks. I so long to be able to right click on any bookmark and choose to have them in alphabet order. Would also like for the little icons to go away. Never been able to figure out how to do this the MAC way. Help.

    I am frustrated with the Bookmarks. I want so much to be able to right click and alphabetize the list. It's been a year and I can get my mind around the process that's there. Also I'd love for those pesky little icons to disappear. Help me please.

    After the release of Firefox 29, several people noticed that after using the Customize feature, most items on the right-click menu for the Bookmarks menu on the menu bar became ''grayed out'' and unusable until you closed and started Firefox back up again. That seems to still be a problem for me in Firefox 36.0.4, so if you used Customize, that could be the explanation.
    You still should be able to click and drag bookmarks around the menu even with the broken right-click context menu.
    And if it's easier than restarting, the context menu still works in the Bookmarks Sidebar (Ctrl+b to open/close) and Library dialog (Ctrl+Shift+b or "Show All Bookmarks").

  • Removing "Open With [Program]" from Right-Click menu

    I was looking around for Applications that could play .avi files and I found Perian  so decided to install it. After installing it I quickly found that it didn't work with all of my .avi files and after some further reading realized that Perian is no longer supported and apparently does not work with QT 10. I decided to uninstall it and use VLC player instead. After uninstalling Perian and removing it from the "System Properties" it looks like it's still showing up in the right-click menu for .avi files.
    My question is how do I remove this from being an option whenever I right-click an .avi file? Perian is no longer installed and I don't want to see it as an option.
    Thanks in advance

    This is probably because all the associated files have not been removed and it is still in the LaunchServices cache. To be sure you remove all associated files may require re-installing the app and using AppCleaner  to trash it and it's supporting files.
    Then, you may also need to clear LaunchServices caches
    Launch /Utilities/Terminal and copy & paste this at the prompt to rebuild LaunchServices: (be sure to copy the entire line it's a scroll)
    Code:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    Then press return. Wait until terminal returns to the command line. Quit Terminal. After that, log out and back in or restart. Let us know

  • I was on facebook and deleted an icon by using the right-click menu but then all my pictures and all profile pictures, could no longer be seen. I was able to view them in Explorer so this is something I did in Firefox. How can I unblock a site?'

    '''I was on facebook and deleted an icon by using the right-click menu but then all my pictures and all profile pictures, could no longer be seen. I was able to view them in Explorer so this is something I did in Firefox. How can I unblock a site?'''

    If you select that right-click context menu entry then you block all images from that domain and not one specific image, so do not use that.
    * Check the exceptions in Tools > Options > Content: Load Images > Exceptions (e.g. sphotos.ak.fbcdn.net)
    You can use these steps to check if images are blocked:
    * Open the web page that has the images missing in a browser tab.
    * Click the website favicon ([[Site Identity Button]]) on the left end of the location bar.
    * Click the "More Information" button to open the "Page Info" window with the Security tab selected (also accessible via "Tools > Page Info").
    * Go to the <i>Media</i> tab of the "Tools > Page Info" window.
    * Select the first image link and scroll down through the list with the Down arrow key.
    * If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.

Maybe you are looking for

  • Sound with video transitions.

    Hey, I'm using DVD Studio Pro 3 and I have a video transition for a button between a menu and a track. Now, the video I am using for the transition has sound, however there is not sound in the transition on the dvd. Can you not have sound, or is ther

  • I have downloaded flash player many time will not complete download.

    I have tried to download many, many, times to download the latest version of your flash player!!!  I have called geek squad to help me fix the problem.  It still has not been resolved.  I have visited you trouble shooting sites and followed all steps

  • My gradient tool seems to be stuck on all black- help? (Photoshop CS6)

    I usually use my gradient tool from black to transparent (linear) when masking the edges of my photos. It just provides a really nice gradual fade and doesn't require me toiling over it with the brush tool. As of last week, my gradient tool seems to

  • Help Please!!!!!!111

    I bought a new 30 gig ipod video 3 days ago. I put some podcasts all my music from itunes on the ipod. I put a video on that wasn't downloaded from itunes and it played fine. Only one THING!!!!! It didn't have any audio! So if anyone can explain to m

  • Weird "other" storage information?

    It's taking up 100GB+ space on my computer but it says 'Zero KB'?