Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Menus appear behind AWT List when spinner is focused

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    19
    My Mood
    Fine
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Menus appear behind AWT List when spinner is focused

    Hi. I have a JFrame with several components. It has a menu at the top, which works fine until a spinner is clicked. The spinner is inside a panel if it helps. When the spinner is interacted with, the menus appear behind the AWT List. They only appear behind the list, and not other things like buttons. Can anyone tell my why this happens, and how I can fix it? Thanks!

    I'm using Eclipse with the WindowBuilder plugin. I couldn't get the plugin to make the AWT List, so I programatically declared the list, and added it to the form, so it would show up in the plugin. Then I resized the List using WindowBuilder. Did I miss something?

    I've included a ZIP file with a runnable JAR and the source code. The problem is in "main.java".

    Sorry, I'm new to Java. This is my first program. Java is almost identical in syntax to C#, which I am an expert in. The only difference seems to be the framework, and instead of "using", its "imports", like VB.NET, which I am also an expert in .

    src.zip


  2. #2
    Member
    Join Date
    Sep 2011
    Location
    United States
    Posts
    30
    My Mood
    Fine
    Thanks
    0
    Thanked 6 Times in 5 Posts

    Default Re: Menus appear behind AWT List when spinner is focused

    Hello Kanyon,

    This seems to be an issue when using both awt and swing. This article should help you find a solution.

  3. The Following User Says Thank You to SerratedMind For This Useful Post:

    Kanyon (September 13th, 2011)

  4. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    19
    My Mood
    Fine
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Menus appear behind AWT List when spinner is focused

    Ah, thank you SO MUCH! That article helped me learn a ton about Swing an AWT. I solved my problem by adding this:

    public void initialize(){
    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    blah blah blah....

    By adding that to the top of my code, the menu's always appear at the front. I've been stuck on this problem for a week, and I can't thank you enough.

    I asked the same question at DreamInCode, but they banned me, blocked my IP, and filed an ISP complaint because my program is "against RuneScape's TOS". I mean, worry about yourself. They weren't very nice

    Thanks again.

Similar Threads

  1. radio button with spinner to create an answer in a textarea box
    By dekon in forum Java Theory & Questions
    Replies: 7
    Last Post: August 12th, 2011, 01:36 AM
  2. Free Application or Software for Java Programming focused on OOP
    By seicair in forum Java Theory & Questions
    Replies: 3
    Last Post: June 14th, 2011, 01:00 AM
  3. Swing Drop Down Menus
    By x3rubiachica3x in forum AWT / Java Swing
    Replies: 2
    Last Post: November 5th, 2010, 04:58 PM
  4. password field, with focused "Enter" button
    By chronoz13 in forum Java Swing Tutorials
    Replies: 1
    Last Post: June 13th, 2010, 05:00 PM
  5. Menu of Menus Help
    By Strivelli in forum Java Theory & Questions
    Replies: 10
    Last Post: June 5th, 2010, 02:40 PM

Tags for this Thread