Results 1 to 8 of 8
  1. #1
    hello2010 is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default Does latest JDK fully support mixing of heavy and light components

    Hi there,

    Older JDKs have problems to support mixing heavy and light components.

    I learned from below article that newer JDKs(since JDK 6 update 12 and JDK7 build 19 releases) can seamlessly mixing heavyweight and lightweight components,
    Mixing heavy and light components

    If the answer to my question is yes, can someone helps to provide some programming tips? I have problems to mix heavy and light components(Canvas and swing components) here.


    Thanks,
    Lin

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    I have problems to mix heavy and light components(Canvas and swing components)
    I fail to understand why you think you need to do this. The page linked from that page (Mixing Heavyweight and Lightweight Components) details several gotchas and at least one so far unresolved bug.

    db

  3. #3
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    My bet is that the problems associated with mixing heavy and lightweight components will never be fully worked out. You should give strong consideration to reworking your project to be 100% lightweight.

  4. #4
    hello2010 is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Thanks for your quick replies!

    Since currently we have no better solution than using GLCanvas(extends Canvas)/JOGL to resolve image tearing issue, we have to consider mix heavy and light components.

    Do you have any other approaches to avoid tearing?

  5. #5
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    If you can't go 100% lightweight, then I recommend the following approach:

    For pull-down's and pop-ups that could intersect a heavy weight component, use heavy weights. For everything else, lightweight components should work fine. This requires care in laying out the gui to avoid turning everything heavyweight.

  6. #6
    hello2010 is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Sorry, I don't quite understand your points. Could you please explain in detail? I am very interested in that.

  7. #7
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Suppose you have a pull down menu that's a lightweight swing JMenu. If that can possibly overlap a heavyweight component, then what'll happen is you'll end up with a partially drawn menu with your heavy weight component drawn over part of it.

    You either need to use a heavyweight menu in that case, or arrange the GUI such that pull down menu's won't ever try to paint over an area occupied by a heavy weight component.

  8. #8
    hello2010 is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Heavy and light components help.
    By FatWhale in forum AWT / Swing
    Replies: 0
    Last Post: 03-08-2011, 11:28 PM
  2. Replies: 14
    Last Post: 09-21-2010, 04:10 PM
  3. AWT/Swing Mixing Still and issue on MAC OSX?
    By Confused in forum AWT / Swing
    Replies: 2
    Last Post: 02-21-2010, 08:34 PM
  4. Reading heavy data on a particular port
    By newbie14 in forum Networking
    Replies: 2
    Last Post: 02-10-2010, 05:40 AM
  5. Heavy and light component mixing
    By Bojevnik in forum AWT / Swing
    Replies: 2
    Last Post: 08-13-2007, 11:23 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
  •