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.
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.
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.
Use JPopupMenu for the component, for which you are interested.
Joined: Aug 07, 2008
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.
Joined: Aug 07, 2008
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).