Fixing heavy weight Canvas problem

I am new at posting in the forums so let me apologize ahead of time if I am not clear enough. I first (incorrectly) posted this topic in the "Java Programming" forum and was led to this forum instead.
I am using NIH's open source "Image Processing and Analysis" libraries, ImageJ, in a program that I am creating. Basically I have a JFrame that is divided into 4 sections via nested JSplitPanes. Each of the 4 sections (top right, top left, bottom right, bottom left) contain a JScrollPane to which I have added a JPanel. I would like to display an image of type ImagePlus (an ImageJ class that extends java.lang.Object) in 3 of these sections.
Each ImagePlus is currently contained in a subclass of an ImageCanvas (another ImageJ class) which extends java.awt.Canvas. This ImageCanvas is then added to the corresponding JPanel. When the JScrollPanes are resized so that they are smaller than the ImagePlus, the image extends outside (and appears over top) the JScrollPane.
In another forum posting I was reading, it was said that instead of extending Canvas you should extend JPanel so that you do not mix AWT and Swing components, which I understand. However, would it be possible to add an ImagePlus to a JPanel since the ImagePlus does not extend java.awt.Component?
If not, could anyone suggest some other way of displaying my ImagePlus in a light weight component?
Thanks for any assistance!

You where given a suggestion in your other posting two days ago.
You where given the exact same suggestion as was given here. In fact you where also given the same to link to the article on mixing components.
Where in the other posting did you comment that the suggestion given did or didn't work??? If you ask a question the least you can do is comment on whether the suggestion was helpfull or not.
So quit multi-posting question and keep the conversation in on posting so everybodyy knows what has already been suggested and so people don't waste their time making the same suggestions.

Similar Messages

  • Forcing PopupFactory to return a heavy weight popup

    Hi, in my application I want to display a Popup over the top of a Canvas that is within a JPanel. The way I am trying to achieve this is:
    PopupFactory popupFactory = PopupFactory.getSharedInstance();
             Popup tipWindow = popupFactory.getPopup(tipComp, tip, theLocation.x, theLocation.y);
             tipWindow.show();The variable tipComp is a heavy weight Canvas, and the variable tip is a subclass of JToolTip we are using to provide extra functionality.
    Using this code the Canvas is obscuring the Popup, as the Popup returned is light weight. Is there any way to force PopupFactory to return a heavy weight popup?

    I did consider this but unfortunately it is not possible. The software has been developed over a long period of time and is very large. It would not be possible to have anything other than a Canvas (we actually have extended Canvas to provide extra functionality). Is there any other way to solve this problem?
    Thanks

  • Quicktime heavy weight components

    Hi guys,
    Im using the QT java api and have hit some problems with their AWT video window component. The reason I'm posting here rather than the QT forums is that I believe this problem is common to all heavy weight components in Java.
    Ok, the QT api offers a factory method for creating what they call QTComponent (awt heavy weight component - extends java.awt.component) which I add to a dedicated JPanel.
    I need to be able to set the visibility of the video window so I do;
    parent_panel.setVisible(value)
    parent_panel.repaint();
    parent_panel.invalidate();
    parent_panel.validate();
    which sets the parent JPanel visibility to hidden but does not hide the child video window. (note: this is called from the event dispatch thread).
    I have tried validate, invalidate, repaint (you name it), on both the parent JPanel and the java.awt.component itself, but this still doesn't fix the problem.
    One thing to note is that if I resize or minimize then maximize the container JFrame the video window disappears. So i'm guessing the handlers for these events execute routines I need to in my 'setvisible' method.
    If anyone could help that would be great.
    Many thanks,
    Alex

    Lightweight components are components whose printed
    sources weigh less than 200 grams.Is a paper and a print face required?

  • Qt heavy weight component

    Hi guys,
    Im using the QT java api and have hit some problems with their AWT video window component. The reason I'm posting here rather than the QT forums is that I believe this problem is common to all heavy weight components in Java.
    Ok, the QT api offers a factory method for creating what they call QTComponent (awt heavy weight component - extends java.awt.component) which I add to a dedicated JPanel.
    I need to be able to set the visibility of the video window so I do;
    parent_panel.setVisible(value)
    parent_panel.repaint();
    parent_panel.invalidate();
    parent_panel.validate();
    which sets the parent JPanel visibility to hidden but does not hide the child video window. (note: this is called from the event dispatch thread).
    I have tried validate, invalidate, repaint (you name it), on both the parent JPanel and the java.awt.component itself, but this still doesn't fix the problem.
    One thing to note is that if I resize or minimize then maximize the container JFrame the video window disappears. So i'm guessing the handlers for these events execute routines I need to in my 'setvisible' method.
    If anyone could help that would be great.
    Many thanks,
    Alex

    Athlon1600 wrote:
    that heavy-weight component is JDIC web browser. It's the only cross-platform browser I know and it's one of the main controls in my GUI. can't change thatCan't help you there.
    JInternalFrame descends from JComponent? yes?Yep. So it's lightweight.
    Well, I'm not smart enough yet to mix lightweight and heavyweight components, but fortunately Google is: [Mixing Heavy and Light Components|http://java.sun.com/products/jfc/tsc/articles/mixing/]
    ~{color:gray}the first hit by the way{color}~

  • Why the AWT components are called heavy-weight and SWING as light-weight?

    Why the AWT components are called heavy-weight and SWING as light-weight?.
    Building our own components means overhead on JVM. hence in what sence the SWING components are called light weight.?
    I know that the Swing componets are the components which are not going to depend upon peer classes and render, OS independent LOOK n FEEL.
    Thanks,
    Sanath Kumar

    All extensions of Component are considered lightweight since, as you point out, they don't have their own dedicated native peer.
    Essentially a lightweight component only has a canvas on which to draw itself and some means of receiving events from the system. In fact, there is no need to have one of these "canvas" and "event" objects for each component - the parent component can manage these abilities on behalf of its children. Eventually you end up with only top-level components needing to be heavyweight in order to communicate with the windowing system.
    A lightweight component therefore has the minimal dependency on the underlying windowing system giving you maximum cross-platform flexibility.
    It is usually true that lightweight => slower and heavyweight => faster since it is reasonable to assume that native peers will be optimal for the windowing system. However, that's not the point of the lightweight/heavyweight distinction.
    Hope this helps.

  • Will there be a fix for Firefox's problems with Hotmail. I have gone back to 3.5.9 but mostly I am disappointed by the lack of action on this serious problem where a major and critical feature of a major international website is unavailable in the Firefox

    Will there be a fix for Firefox's problems with Hotmail. I have gone back to 3.5.9 but mostly I am disappointed by the lack of action on this serious problem where a major and critical feature of a major international website is unavailable in the Firefox browser.
    == URL of affected sites ==
    http://www.hotmail.com

    We've reached out to the Hotmail team and they've determined that this is a bug in their code. (It was masked by a timing issue in 3.5 that was fixed in 3.6.) We've worked with them to develop a fix but they may not have deployed it yet.

  • How im suppose to fix the auto shutdown problem in my iphone 3gs after updating to ios 5.1.1 this problem has made me a mobile ****** in my house and an loser in thing care so if any solution to this problem let me know

    how im suppose to fix the auto shutdown problem in my iphone 3gs after updating to ios 5.1.1 this problem has made me a mobile ****** in my house and an loser in thing care so if any solution to this problem let me know

    What "auto shutdown problem" are you talking about?

  • When will there be a fix for the permissions problem in iTunes 11.1.1? I get a list of three or four-hundred when I run the repair program.

    Does anyone know when will there be a fix for the permissions problem in iTunes 11.1.1? I have a list of three to four hundred repairs everytime I use the repair program. ~Mike.

    SinkeMH wrote:
    Does anyone know when will there be a fix for the permissions problem in iTunes 11.1.1
    Likely someone does but Apple has not stated if/wehn.
    I have a list of three to four hundred repairs everytime I use the repair program. ~Mike.
    Then don't use the repair program unless you are actually having an issue.

  • Why Apple don't fix half year serious problem with HD3000, Lion and Adobe products? Doesn't Apple really care about advanced users?

    Why Apple don't fix half year serious problem with HD3000 drivers, Lion and Adobe products? Doesn't Apple really care about advanced users?
    I have Mac mini and Macbook Pro 13". Bouth with HD3000. And I can't work at all. With Snow Lepard I had no problems. It's tiny problem in code. And such pain for lots of users!

    If you have a problem with Adobe products, voice your issues with them.
    It is the software developers responsibility to maintain compatability
    with any operating system, beit OSX or Windows.

  • They fixed the right click problem, but now there is a bigger problem

    after updating, I can use my right click perfectly on Windows XP. however, my windows XP starts to restart very often-which means the "blue-sceen" comes out very often. I believe many poeple has this problem because I had already read couple of complains...Well...I hope apple can fix it soon.

    I could not right click on my macbook's Precision aluminum unibody enclosure under windows xp, and after updating the trobubleshooter, it works. However, my windows starts to restart again and again (the blue screen) and it says it is because the applemtp.sys has some problems. I read couple of others people's experiences on the Internet, and they all so it started to happen after they fix the right click problem.

  • Is there a fix for the WIFI problem with Lion? How can I get Lion off of my Mac?

    Is there a fix for the WIFI problem with Lion? How can I get Lion off of my Mac?

    gmiller0 wrote:
    My mac has 10.7.3 and will not connect to wifi after it wakes up. Have contacted AppleCare but the problem cannot seem to be resolved.. I guess this is a major issue with Lion:(
    What model of Mac?  I have a MBP running 10.7.3 and do not have that issue.  From the other couple of posts I've seen about it, it seems to be maybe an issue with some iMacs?  Have your tried searching the Lion or iMac forums for similar issues, just to see if anyone has hit on why it is happening?

  • At Apple Store we reset my Iphone 4s to factory settings in an unsuccessful bit to fix my Wi-fi problem.  Now I'm home trying to get my contacts, pics, etc. back.  I'm lost...

    At Apple Store we reset my Iphone 4s to factory settings in an unsuccessful bit to fix my Wi-fi problem.  Now I'm home trying to get my contacts, pics, etc. back.  I'm lost...

    Okay - see if the instructions here help: http://support.apple.com/kb/ph12521
    ~Lyssa

  • Light weight && heavy weight

    hi
    i have on doubt in swing... awt are heavy weight && swing are light weight .awt are system dependedent ....iam right..
    if right System dependent in this sence java is plaftform independent
    so how is it possible..
    pls give me details
    regards
    kedar

    Light weight components: To draw the components the jvm takes the os routine.
    Heavy weight components: To draw the components the JVM takes its own routines.
    You can check this. If you draw the awt component in one os it gives the different layout in other os. But this is not in the case of swing.This is the main difference . That's why the main components in big project are done in swing.
    if in doubt please ask?
    javasans

  • Why is my iPhones volume silent only between the hours of 8pm and 7am when the night selection isn't selected? How can I fix my iPhone 4 problem?

    Why is my iPhones volume silent only between the hours of 8pm and 7am when the night selection isn't selected? How can I fix my iPhone 4 problem?

    May be you have turned the DO NO DISTURB in your iphone settings.
    Check as below DND settings
    Settings>>Do Not Disturb
    If you are iPhone is on version iOS 5.X there was a bug which does not let the DO NOT DISTURB function properly.
    SO, its better you to latest iOS version 7.0.4, no other versions of iOS are signed by APPLE hence forth.

  • A Fix for Wireless Connection Problems

    I’ve been struggling with connection problems for a week. Thankfully, I found a fix. Your mileage may vary, but this may be your answer:
    Fix for Wireless Connection Problems on MacBook Pro

    Yeah BR, please tell me what your cure is. I have the same setup as you, Vista with the same wireless card you have. Cannot stay connected to the internet. Have spent hours on the phone with tech support and they can't fix it. I hate this f....ing computer, will never buy another one. Please let me know what you did. Once I get it running right I'm selling it and will buy a cheap Dell, never have any problems with them. I have keyboard problems, capital letter problems, connection problems, and download can take 1 to 2 days. Pure BS!!!!!!!!!!!!!!!!!

Maybe you are looking for