0

I have separately changed the default look and feel code of my Java project build using Netbeans look and feel setting code in each Jframe.

It runs perfectly when I run Jframes separately.

But When I run complete project.It always shows the default Nimbus look and feel, even though I have changed look and feel of JFrames seperately.

Can anyone suggest me to apply windows Look and feel to complete project?

Thank you very much. I am a beginner for programming.

mmc
  • 751
  • 2
  • 7
  • 12
  • *"even though I have changed the JFrames seperately."* See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) BTW - you forgot to ask a question. – Andrew Thompson Mar 27 '15 at 15:31
  • [Setup Windows look and feel as Default Netbeans Java project](http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html) – mKorbel Mar 27 '15 at 15:34

1 Answers1

1

I have resolved the problem. It was an easy task,

Just put this code in your Main Class of the project

    for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Windows".equals(info.getName())) {       javax.swing.UIManager.setLookAndFeel(info.getClassName());
}
}

**REMEMBER TO SURROUND THE BLOCK WITH TRY-CATCH

I have checked this even this works through many look and Feels, If you need to maintain through out the project runtime in GUI

mmc
  • 751
  • 2
  • 7
  • 12