tn5250j/src/org/tn5250j My5250.java,1.34,1.35

[email protected]
Newsgroups gmane.comp.java.tn5250j.cvs
Message-ID <[email protected]>
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j
In directory sc8-pr-cvs1:/tmp/cvs-serv1386

Modified Files:
	My5250.java 
Log Message:
Fix for Mac OS to not use the kunstoff look and feel as it causes problems

Index: My5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/My5250.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** My5250.java	25 Nov 2003 10:41:15 -0000	1.34
--- My5250.java	30 Nov 2003 08:30:14 -0000	1.35
***************
*** 35,38 ****
--- 35,39 ----
  
  import org.tn5250j.tools.*;
+ import org.tn5250j.tools.system.OperatingSystem;
  import org.tn5250j.event.*;
  import org.tn5250j.gui.TN5250jSplashScreen;
***************
*** 64,84 ****
        splash.setVisible(true);
  
!       try  {
! 		UIManager.setLookAndFeel(
! 			"com.incors.plaf.kunststoff.KunststoffLookAndFeel");
!       }
!       catch(Exception e) {
!       	  try {
! 			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
! 		} catch (ClassNotFoundException e1) {
! 			e1.printStackTrace();
! 		} catch (InstantiationException e1) {
! 			e1.printStackTrace();
! 		} catch (IllegalAccessException e1) {
! 			e1.printStackTrace();
! 		} catch (UnsupportedLookAndFeelException e1) {
! 			e1.printStackTrace();
! 		}
!       }
  
        loadSessions();
--- 65,70 ----
        splash.setVisible(true);
  
!       loadLookAndFeel();
! 
  
        loadSessions();
***************
*** 101,104 ****
--- 87,117 ----
        splash.updateProgress(++step);
  
+    }
+ 
+ 
+    private void loadLookAndFeel() {
+ 
+       // we only want to try and load the Kunststoff look and feel if it is not
+       //  for the MAC operating system.
+       if (!OperatingSystem.isMacOS()) {
+ 
+          try  {
+             UIManager.setLookAndFeel("com.incors.plaf.kunststoff.KunststoffLookAndFeel");
+          }
+          catch(Exception e) {
+             try {
+                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+             } catch (ClassNotFoundException e1) {
+                e1.printStackTrace();
+             } catch (InstantiationException e1) {
+                e1.printStackTrace();
+             } catch (IllegalAccessException e1) {
+                e1.printStackTrace();
+             } catch (UnsupportedLookAndFeelException e1) {
+                e1.printStackTrace();
+             }
+          }
+ 
+       }
     }
  




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.