Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hi folks just want to know how d

Status
Not open for further replies.

jakhan

IS-IT--Management
Jul 22, 2000
75
hi folks

just want to know how do i change Look and Feel of the application using UIManager

Kindly tell me how do i write code to switch to Motif, Window or Metal Look and feel

thanks

Jahangir
 
Here is a very simple example of the UIManager:

declare this in class:

private UIManager.LookAndFeelInfo looksAvail [];

put this in constructor of class program:

looksAvail = UIManager.getInstalledLookAndFeels();

put this where you want to change it:

eg.
int subs = 0;
try {
UIManager.setLookAndFeel(looksAvail[subs].getClassName());
SwingUtilities.updateComponentTreeUI(this);
}
catch (Exception e)
{
e.printStackTrace();
}

// subs 0 - Metal, 1 - Motif, 2 - Windows.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top