6 Replies - 1382 Views - Last Post: 05 August 2010 - 04:17 AM Rate Topic: -----

#1 Tapas Bose  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 472
  • Joined: 09-December 09

Custom Look And Feel

Posted 05 August 2010 - 03:07 AM

Hello everybody. I saw a site , there are some look and feel images. Can any body give me idea how to run my application in these custom look and feel. I don't know weather or not this question is relevant. Pardon me, if I am wrong.
Thank you.
Is This A Good Question/Topic? 0
  • +

Replies To: Custom Look And Feel

#2 cfoley  Icon User is online

  • Cabbage
  • member icon

Reputation: 1998
  • View blog
  • Posts: 4,150
  • Joined: 11-December 07

Re: Custom Look And Feel

Posted 05 August 2010 - 03:19 AM

I clicked the download link at random and right on that page it told you how to do it:

Quote

To make LiquidLnF the current L&F, add this line to the beginning of your main method:
UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");


The only thing it doesn't tell you is their .jar file needs to be in the class path.
Was This Post Helpful? 1
  • +
  • -

#3 YasuoDancez  Icon User is offline

  • D.I.C Head

Reputation: 20
  • View blog
  • Posts: 135
  • Joined: 30-September 09

Re: Custom Look And Feel

Posted 05 August 2010 - 03:31 AM

In your main class you have to import Swings UIManager and use it's method setLookAndFeel( lool and feel name here )
Then you can instantiate an instance of your application

try {
			

UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
	new TextPadApp();
} 
catch (Exception e) {
	e.printStackTrace();
}
	
}





you can get an array of the installed look and feels through the getInstalledLookAndFeels() method from UIManager.
Then you can pull the look and feel you want from the array by the index.
If you want to see what they are you can loop through the array and system println or assign them to a string to see what you want to pick...

try {
			LookAndFeelInfo[] looks = UIManager.getInstalledLookAndFeels();
			String lookAndFeels= "";
			
			for(int i = 0; i < looks.length; i++){
				lookAndFeels +=  looks[i].getClassName() + "\n";	
			}
			System.out.println( lookAndFeels );
			
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");

			
			new TextPadApp();
		} 
		catch (Exception e) {
			e.printStackTrace();
		}


Was This Post Helpful? 1
  • +
  • -

#4 Tapas Bose  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 472
  • Joined: 09-December 09

Re: Custom Look And Feel

Posted 05 August 2010 - 03:44 AM

Thank you...
Thank you...
Thank you...
Very much.
:clap: :clap: :clap: :clap: :clap: :clap:
Was This Post Helpful? 1
  • +
  • -

#5 YasuoDancez  Icon User is offline

  • D.I.C Head

Reputation: 20
  • View blog
  • Posts: 135
  • Joined: 30-September 09

Re: Custom Look And Feel

Posted 05 August 2010 - 03:46 AM

lol you're welcome.
Was This Post Helpful? 0
  • +
  • -

#6 cfoley  Icon User is online

  • Cabbage
  • member icon

Reputation: 1998
  • View blog
  • Posts: 4,150
  • Joined: 11-December 07

Re: Custom Look And Feel

Posted 05 August 2010 - 04:15 AM

lol :bananaman:
Was This Post Helpful? 0
  • +
  • -

#7 Tapas Bose  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 472
  • Joined: 09-December 09

Re: Custom Look And Feel

Posted 05 August 2010 - 04:17 AM

:bananaman:

This post has been edited by Tapas Bose: 05 August 2010 - 04:19 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1