• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Right click popup menu

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic