Add SpellChecker menu to existing oopup menu

  • Anonymous - 2011-10-26


    I can get the popup menu with the suggestions like that:

    JPopupMenu popup = SpellChecker.createCheckerPopup();
    text.addMouseListener(new PopupListener(popup));

    but it seems not possible to add another JMenuItem (like common copy/paste) to that popup menu. Is that right? Can that be done otherwise?

    Thanks for the great library. I use it for the Storybook project:

  • i-net software

    i-net software - 2011-10-26

    If you use the suggestions menu directly then it is not possible. On every check it will cleared completely. But you can use the follow code with a submenu.

    JPopupMenu menu = new JPopupMenu();
    //.... add your own entries here
    menu.add( createCheckerMenu() );
    menu.add( createLanguagesMenu() );
    //.... add your own entries here
    text.addMouseListener( new PopupListener(menu) );
  • Anonymous - 2011-10-28

    Many thanks for the quick reply, works fine!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks