Results 1 to 4 of 4
  1. #1
    Sutured is offline Member
    Join Date
    Mar 2012
    Posts
    30
    Rep Power
    0

    Default Components one over the other

    Hello,

    I create a frame and add a panel in it. I set panel layout to null so I can paint it myself giving the exact bounds.

    I add a button A, then a button B. I animate the button B and at some point it passes over A. My problem is that it passes behind A and not in front as intended.

    How can I choose which button is on top in view?

    Thank you.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Components one over the other

    Use a JLayeredPane and specify which layer each component is to be placed on. The tutorials will show you how to do this.

  3. #3
    Sutured is offline Member
    Join Date
    Mar 2012
    Posts
    30
    Rep Power
    0

    Default Re: Components one over the other

    I read the API and implemented the JLayeredPane, as you suggested.

    Thank you Fuba.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Components one over the other

    You're quite welcome! Best of luck!

Similar Threads

  1. Components as containers
    By wired-in=p in forum AWT / Swing
    Replies: 8
    Last Post: 09-12-2011, 04:19 AM
  2. components display
    By asmitarnd in forum AWT / Swing
    Replies: 7
    Last Post: 04-13-2011, 08:18 AM
  3. Different components in an AWT list
    By alinaqvi90 in forum AWT / Swing
    Replies: 10
    Last Post: 08-13-2010, 11:39 AM
  4. Components of SWingx.
    By SANDY_INDIA in forum Advanced Java
    Replies: 4
    Last Post: 07-14-2008, 10:46 AM
  5. Gui Components
    By Marty in forum New To Java
    Replies: 1
    Last Post: 05-28-2007, 05:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •