<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>878</bug_id>
          
          <creation_ts>2013-10-30 08:57:07 +0100</creation_ts>
          <short_desc>JAWTWindow&apos;s HierarchyListener doesn&apos;t set component visible (again) on &apos;addNotify(..)&apos; - GLCanvas in JtabbedPane disappear</short_desc>
          <delta_ts>2013-10-31 04:35:22 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>awt</component>
          <version>2</version>
          <rep_platform>pc_all</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>849</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Franco">fzanelli</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs>887dbdb34d71a3a266b7854bc9a3842aad1032f9</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3216</commentid>
    <comment_count>0</comment_count>
    <who name="Franco">fzanelli</who>
    <bug_when>2013-10-30 08:57:07 +0100</bug_when>
    <thetext>I have experienced a problem that didn&apos;t appear in version 2.0.2 but appears since version 2.1.0.
I have a Jframe with a JtabbedPane composed by 2 Tabs and a GLCanvas always contained in the panel of the selected tab. When I switch form tab1 to tab2, glcanvas is added to tab2, when I switch back to tab1 glcanvas is added to tab1.
The problem is when I switch back to tab1, glcanvas disappear. I post the code of my simple application:

public class JoglTabbedPaneError extends JFrame {

    private GLCanvas glCanvas;
    private JPanel panel1;
    private JPanel panel2;
    private final JTabbedPane tabbedPane;

    public JoglTabbedPaneError() {
        panel1 = new javax.swing.JPanel();
        panel2 = new javax.swing.JPanel();

        panel1.setLayout(new BorderLayout());
        panel2.setLayout(new BorderLayout());

        GLProfile profile = GLProfile.get(GLProfile.GL2);
        GLCapabilities glCapabilities = new GLCapabilities(profile);        
        glCanvas = new GLCanvas(glCapabilities);
        panel1.add(glCanvas, BorderLayout.CENTER);

        tabbedPane = new JTabbedPane();
        tabbedPane.addTab(&quot;tab1&quot;, panel1);
        tabbedPane.addTab(&quot;tab2&quot;, panel2);

        tabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
            @Override
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                if (glCanvas == null) {
                    return;
                }
                if (tabbedPane.getSelectedIndex() == 0) {
                    panel1.add(glCanvas, BorderLayout.CENTER);
                } else {
                    panel2.add(glCanvas, BorderLayout.CENTER);
                }
            }
        });

        setContentPane(tabbedPane);        
        setSize(640,480);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new JoglTabbedPaneError().setVisible(true);
    }

}

If I use jogl 2.0.2 I can switch from tab1 to tab2 and viceversa and this problem doesn&apos;t appear</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3232</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-31 02:08:55 +0100</bug_when>
    <thetext>Regression of commit e33e6374e0be0454f7e9732b5f897f84dbc3c4dc (Fix for Bug 729 and Bug 849) !</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3235</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-31 03:47:18 +0100</bug_when>
    <thetext> JAWTWindow&apos;s HierarchyListener doesn&apos;t set component visible (again) on &apos;addNotify(..)&apos; 

It only renders the component invisible after removeNotify() which is performed implicit anyways ..

Case java.awt.event.HierarchyEvent.DISPLAYABILITY_CHANGED
shall perform similar as our java.awt.event.HierarchyEvent.SHOWING_CHANGED impl.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3236</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-10-31 04:35:22 +0100</bug_when>
    <thetext>887dbdb34d71a3a266b7854bc9a3842aad1032f9
  - Fixed as described in comment 2
  - Tested on Gnu/Linux X11 and OSX incl. re-test Bug 729 and Bug 849 unit tests.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>