flamingo
  1. flamingo
  2. FLAMINGO-22

getting exceptions when trying to integrate jribbon

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.1
    • Fix Version/s: milestone 1
    • Component/s: ribbon
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      22

      Description

      kirill,

      Trying to put a ribbon in the open source project TN5250J which can be located
      at http://tn5250j.sourceforge.net/. When I try to extend TN5250J JFrame with
      your JRibbonFrame, I get null pointer exceptions in the layoutContainer. While
      debugging the code I found a null pointer that is being returned from
      ribbon.getSelectedTask() which causes For (JRibbonBand ribbonBand :
      selectedTask.getBands()) to fail.

      TN5250 is a rather large app, I can try and whittle down. You may just want to
      bring the source down and extend the TN5250jFrame.java class. I took your
      basiccheckribbon example and made it a class and changed JFRAME to my class in
      TN5250jFrame.java.

      If you have other ideas, I would be open to discuss. I thought that maybe I
      could put your components on a JPanel, but looks like you require a jframe?

      Thanks,

      Dennis

        Activity

        Hide
        dennisnoto added a comment -

        Some more info....

        Looks like your code and TN5250 have overridden the update() and paint()
        methods. This maybe the problem because in TN5250jSplashScreen, there is a
        Notify() buried in the paint method.

        In BasicRibbonUI
        public void update(Graphics g, JComponent c)
        public void paint(Graphics g, JComponent c)

        In TN5250jSplashScreen
        public void update(Graphics g)
        public synchronized void paint(Graphics g)

        Your thoughts?

        Den

        Show
        dennisnoto added a comment - Some more info.... Looks like your code and TN5250 have overridden the update() and paint() methods. This maybe the problem because in TN5250jSplashScreen, there is a Notify() buried in the paint method. In BasicRibbonUI public void update(Graphics g, JComponent c) public void paint(Graphics g, JComponent c) In TN5250jSplashScreen public void update(Graphics g) public synchronized void paint(Graphics g) Your thoughts? Den
        Hide
        kirillcool added a comment -

        This sounds like a possible EDT violation in the code. The code in
        RolloverCleanerThread is accessing UI-related properties of the ribbon frame,
        and is such is running on the EDT - with SwingUtilities.invokeLater. You can
        test your code with Substance 5.0 release that tests the EDT violations on
        component creation, or use the CheckThreadViolationRepaintManager from
        SwingHelper project on swinghelper.dev.java.net

        As i said once again - if you can provide a small (<100 lines) test class to
        illustrate the issue, that would help me to analyze the problem on my machine.
        The longer the test class is (certainly for downloading the entire project), the
        less likely it is that i can get to it with the time i have.

        Thanks
        Kirill

        Show
        kirillcool added a comment - This sounds like a possible EDT violation in the code. The code in RolloverCleanerThread is accessing UI-related properties of the ribbon frame, and is such is running on the EDT - with SwingUtilities.invokeLater. You can test your code with Substance 5.0 release that tests the EDT violations on component creation, or use the CheckThreadViolationRepaintManager from SwingHelper project on swinghelper.dev.java.net As i said once again - if you can provide a small (<100 lines) test class to illustrate the issue, that would help me to analyze the problem on my machine. The longer the test class is (certainly for downloading the entire project), the less likely it is that i can get to it with the time i have. Thanks Kirill
        Hide
        dennisnoto added a comment -

        More info ....

        For a test, I changed the wait() to wait(1) to get around the notify. Then the
        application hung on an invokeAndWait in the EventQueue which came from a
        dispose() statement in TN5250jSplashScreen.

        EventQueue.invokeAndWait(action) hangs

        Seems that the object monitor has changed when using your product?? That would
        be the only way I can think of why the calls to invokeAndWait calls don't work
        anymore.

        Your thoughts?

        Den

        Show
        dennisnoto added a comment - More info .... For a test, I changed the wait() to wait(1) to get around the notify. Then the application hung on an invokeAndWait in the EventQueue which came from a dispose() statement in TN5250jSplashScreen. EventQueue.invokeAndWait(action) hangs Seems that the object monitor has changed when using your product?? That would be the only way I can think of why the calls to invokeAndWait calls don't work anymore. Your thoughts? Den
        Hide
        kirillcool added a comment -

        Just as i said before - use the proposed methods to detect whether you have EDT
        violations in your code.

        Thanks
        Kirill

        Show
        kirillcool added a comment - Just as i said before - use the proposed methods to detect whether you have EDT violations in your code. Thanks Kirill
        Hide
        kirillcool added a comment -

        Closing as WORKSFORME since there has been no communication from the originator
        since last September. Please reopen if you have a small test application that
        reproduces this issue under the latest 4.2dev drop.

        Thanks
        Kirill

        Show
        kirillcool added a comment - Closing as WORKSFORME since there has been no communication from the originator since last September. Please reopen if you have a small test application that reproduces this issue under the latest 4.2dev drop. Thanks Kirill

          People

          • Assignee:
            kirillcool
            Reporter:
            dennisnoto
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: