kohinoor2007
Programmer
Hi Guys,
Have some questions regarding invoking a popup menu.Hope some one could give me a hand on this one...
Please see attached Figure as well.
[1]
Have a Table having a certain number of rows.want to create a pop up menu when user selects a cell and rightclicks from that cell.
But I read the following from the java tutorial:
>>To bring up a popup menu ( JPopupMenu), you must register a mouse listener on each >>component that the popup menu should be associated with. The mouse listener must >>detect user requests that the popup menu be brought up.
So is it possible to bring up the popupmenu when rightclicking on a certain cell ,rather than a component(Ofcourse cells belong to the component,but dont want the popup window to come up when right clicking on any cell in the table).How can I achive this behaviour.
[2]After clicking on one of the menuItem from the popupmenu,want a window with some data to be displayed as shown in the attached figure.This window should have scrollbars & each string should be in a different line in this window.
Also the window position or origin should be just below the cell where the right click occured.The window should vanish when selection is made on any other cells.
Would be nice if someone could tell me how these things are to be done.A code snippet would be great....
Thanks
Have some questions regarding invoking a popup menu.Hope some one could give me a hand on this one...
Please see attached Figure as well.
[1]
Have a Table having a certain number of rows.want to create a pop up menu when user selects a cell and rightclicks from that cell.
But I read the following from the java tutorial:
>>To bring up a popup menu ( JPopupMenu), you must register a mouse listener on each >>component that the popup menu should be associated with. The mouse listener must >>detect user requests that the popup menu be brought up.
So is it possible to bring up the popupmenu when rightclicking on a certain cell ,rather than a component(Ofcourse cells belong to the component,but dont want the popup window to come up when right clicking on any cell in the table).How can I achive this behaviour.
[2]After clicking on one of the menuItem from the popupmenu,want a window with some data to be displayed as shown in the attached figure.This window should have scrollbars & each string should be in a different line in this window.
Also the window position or origin should be just below the cell where the right click occured.The window should vanish when selection is made on any other cells.
Would be nice if someone could tell me how these things are to be done.A code snippet would be great....
Thanks