look and feel

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 55
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

look and feel

 
0
  #1
Aug 20th, 2004
I'm in need of determining and implementing the LookAndFeel of the operating system default within a swing frame, whatever that default may happen to be (and without using the string "com.sun.java.swing.plaf..." in the code whatsoever. When simply leaving the UIManager.setLookAndFeel() as is when creating the frame, the correct OS default doesent show up. I'm assuming that Java swing components like to have a LookAndFeel that is java default, not operating system default...
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 55
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: look and feel

 
0
  #2
Aug 22nd, 2004
Atlast I figured it out

"UIManager.getSystemLookAndFeelClassName()" will return the name of the default system look and feel... From there just do UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); and you're all set!
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 15
Reputation: ZEEPLE is an unknown quantity at this point 
Solved Threads: 0
ZEEPLE ZEEPLE is offline Offline
Newbie Poster

Re: look and feel

 
0
  #3
Aug 24th, 2004
Could you show a sample of this..I am building a menu of sorts and tried this but when compiled I recieved an exception error stating the classname has to be caught from the system to be thrown..


PanelDemo.java [71:1] unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
^
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 55
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: look and feel

 
0
  #4
Aug 24th, 2004
Originally Posted by ZEEPLE
PanelDemo.java [71:1] unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
^
use the try catch blocks ....
  1. try{
  2. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  3. }
  4. catch(ClassNotFoundExecption e){
  5. System.out.println("class not found");
  6. }

Let me know if it works.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC