Results 1 to 3 of 3
  1. #1
    JSK
    JSK is offline Member
    Join Date
    Nov 2007
    Posts
    3
    Rep Power
    0

    Default Canvas rendered over JCombobox menu

    Hello everyone,
    I've been googling and asking for help for a while, but no success.
    I've got a Canvas where some stuff is drawn, and a few buttons and comboboxes next to it, lined in a row under the drawing area. When I click on any of the comboboxes, part of the drop-down menu has to be rendered over canvas, but it is always behind it:
    http://img69.imageshack.us/img69/3017/15605599kh6.gif
    Why does this happen, and what can I do?

    tnx in advance

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Canvas is an AWT, heavyweight component. J–prefix components are Swing, lightweight components. Heavyweight components get rendered on top of/over/above lightweight components and obscure them. Although you can mix them there are some things to be aware of in doing so. For a discussion of this see Mixing heavy and light components.
    If you choose to stick with Swing you could replace the Canvas with a JPanel.

  3. #3
    JSK
    JSK is offline Member
    Join Date
    Nov 2007
    Posts
    3
    Rep Power
    0

    Default

    Oh, I think that's a perfect reply, thanks a lot, it works now :)

Similar Threads

  1. Replies: 7
    Last Post: 05-09-2008, 07:54 AM
  2. Calling displayable from a canvas class
    By Snalk in forum CLDC and MIDP
    Replies: 0
    Last Post: 03-28-2008, 11:58 PM
  3. Using SWT Canvas
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-08-2008, 09:06 AM
  4. Canvas question
    By christina in forum Advanced Java
    Replies: 1
    Last Post: 08-03-2007, 07:21 PM

Posting Permissions

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