patch for JDK 5.0 for JFrame layout

[email protected] Mon, 22 Aug 2005 19:14:27 +0200
Newsgroups gmane.comp.embedded.carlsbad-cubes
Organization Code Lutin
Message-ID <[email protected]>
Hello,

I think swixml doesn't work properly with JDK 5.0.

I have modified Parser.java to detect RootPaneContainer when we want to
get LayoutManager.

Before this patch, i can't change layout on frame, after there is no probleme.


--- swixml_144/src/org/swixml/Parser.java       2005-06-04 15:25:36.000000000 +0200
+++ swixml_144.patch/src/org/swixml/Parser.java 2005-08-03 22:24:13.000000000 +0200
@@ -518,7 +518,15 @@
     //  process child tags
     //

-    LayoutManager layoutMgr = obj instanceof Container ? ((Container) obj).getLayout() : null;
+// BB patch //
+    LayoutManager layoutMgr = null;
+    if(obj instanceof RootPaneContainer){
+      layoutMgr = ((RootPaneContainer)obj).getContentPane().getLayout();
+    } else if (obj instanceof Container){
+      layoutMgr = ((Container) obj).getLayout();
+    }
+//    LayoutManager layoutMgr = obj instanceof Container ? ((Container) obj).getLayout() : null;
+// BB patch //

     Iterator it = element.getChildren().iterator();
     while (it != null && it.hasNext()) {


-- 
Benjamin
--------------------
email: [email protected]           () campagne du ruban ascii
http://www.codelutin.com               /\ pour les mails en ascii