Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Glad you found the solution.
  2. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    What happened when you tried what I suggested?

    Have you read the API documentation for the setBackground method to see if there is anything there that could help you?
  3. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    I can not do anything with all those little pieces of code.
    Did you see my question? What happens when you do this:
    Are you able to set the original color of any of the menuitems BEFORE there is...
  4. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Are you able to set the original color of any of the menuitems BEFORE there is any mouse movement?
    Try setting the color immediately after the call to setIcon.
  5. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    You need to make and post a small, complete program that compiles, executes and shows the problem.
  6. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Sorry, I do not know anything about the gui menus.
  7. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Are you able to set the color of the menus at any time? Not just in a listener.
  8. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Sorry, I do not know what the problem is. Can you explain?
  9. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Please explain what that means?

    When I compile and execute, it shows the trayicon. Then what do I need to do to see the problem?
  10. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Here's an attempt. I copied a lot of your code:


    /*
    Creates a small, transparent window in upper left of screen (60,20) for testing
    Creates a TrayIcon with a MouseListener
    When the TI is...
  11. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Sorry. I think it would be a lot of work and I do not have the time right now.

    Try asking your question on this forum: https://coderanch.com/forums

    Continued here: ...
  12. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Maybe instead of a popup to show the menu, use a dialog.
  13. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    The problem with the code at that link is that it is just bits and pieces. It is not code that can be copied, compiled and executed for testing.
  14. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    What is that? Before you were asking about the text inside of the menuitems.
    What are you wanting to now? What things are supposed to be right to left?



    Sorry, I do not see anything called...
  15. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    What is Pointer? Where is it used?

    Can you use the AWT versions of the components and set the Font to be RTL?
  16. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Since you have written your own code for displaying the popup, you need to find a way to get focus or to detect when a click is outside the menuitems.

    If you use the old AWT code: ...
  17. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    But that is not detectable by the program; so then it needs to require a user click on a menu item.
  18. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    I noticed the same thing: popup menus do not get the focus.

    Another solution make be to always hide the popup after any item is selected.
  19. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    Study the documentation for the Focus system to see how it works:
    http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html...
  20. Replies
    42
    Views
    7,874

    [SOLVED] Re: close JPopupMenu after focus lost

    You may have to took at the how focus works.
    An interesting discussion here: https://stackoverflow.com/questions/2421914/showing-hiding-a-jpopupmenu-from-a-jbutton-focuslistener-not-working
Results 1 to 20 of 20