JMenu Doesn't Appear
Author |
Message |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Mon Jul 03, 2006 8:20 pm Post subject: JMenu Doesn't Appear |
|
|
Not an interesting help question, but it's been bugging me for a few hours.
I wanted to try out some GUI stuff in Java, and it works fine on it's own, but when I combine it with some draw methods, the GUI components don't appear. I've looked all over the Java docs for something which I've possibly missed when overloading the various methods, and other stuff like that, but to no avail.
Attached is a quick example I set up to demonstrate when this happens with double buffering.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
MenuTest.java |
Filesize: |
1.81 KB |
Downloaded: |
115 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
HellblazerX
![](http://www.plamania.co.kr/shopimages/plmtest/2910040000213.jpg)
|
Posted: Mon Jul 03, 2006 8:54 pm Post subject: (No subject) |
|
|
I would keep the double buffering in a separate component of its own, like a JPanel, and then add that JPanel in your JFrame. What you did was you overloaded the JFrame's paint () method, so the JMenuBar was not draw in at all. However, if you included a super.repaint () in there, what would happen is that your double buffer would disappear, and the only thing you would be able to see is the GUI components.
|
|
|
|
|
![](images/spacer.gif) |
0101fx
|
Posted: Thu Jul 13, 2006 12:40 am Post subject: (No subject) |
|
|
try with threads because are process independient..and you will se how wondelfull is java
|
|
|
|
|
![](images/spacer.gif) |
|
|