• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Right click popup menu

 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I added a right click popup menu to my codes with the help of Netbeans 6.7.1 to auto generate the codes. It worked on Linux platform ( my development platform is on Linux ). i wanted to test it out on Windows to see how it worked so i deployed it on a win XP Home Edition with the latest Java (Sun) version as of now (I did a check). Somhow, right click does not cause the popup to appear which had worked on other machines i have tested (Linux). I doubt if this is the issue of OS platform since Swing GUI is suppose to be platform independent because it's Java.\

Does anyone have any idea what went wrong ?



Above is a short snapshot of the code.I tried to attach the java file but javaranch system doesn't accept it so I gave it a plain text and also tried a '.txt' but it doesn't accept so below is the entire codes if you want.

 
Rob Camick
Ranch Hand
Posts: 2600
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is about a popup, so all you need is a JFrame with a component and the code for the popup. I'm not going to even bother looking at all that code, since 90% of the code has nothing to do with your described problem.

If you need further help then you need to create a SSCCE (Short, Self Contained, Compilable and Executable, Example Program), that demonstrates the incorrect behaviour.

Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
 
santhosh varala kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JPopupMenu for the component, for which you are interested.
 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I did have a JPopupMenu and the program is working totally fine on Linux but when i use it on Windows... why did it not work ? The problem that puzzles me is that it works on Linux but fails to display the popup on Windows. Both are using Java 6 and are the latest updates available. I doubt it's about the codes... I have cross referenced my codes with the codes available on the internet and they are correct supposedly. Why could Linux(Ubuntu) do as what i wanted but not for Windows (XP) ? Both systems are running Sun's JRE.
 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are the codes I used:



Note: The initComponents() are generated by Netbeans IDE which is presumably correct.

The same thing happened... Linux using both OpenJDK and Sun Java's Official VM running on Java 6 could work and display the popup but not on Windows XP running Java 6 (Sun Java).
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
posting 800 lines of code, then not having the decency to post a follow up that you have an answer in the sun forums.

I look forward to ignoring your next problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic