1.How can i change the background colour of my GUI(swing).I want the default colour gray to be changed. I'm able to change the background colour for a panel but not on the whole screen.
2.How can i restrict the textbox to 3 characters and when all the 3 are entered it has to set focus to the next one.(For ex,in the case of Ip-address).
Oops on the second part, add a KeyListener to the first JTextComponent which checks to see if the entry is complete, and have the call the requestFocus method on the next JTextComponent
Although you can use java.awt.Component.setBackground(Color) as previously noted, if you need to do so on all Compnonents in the app (for consistency) investigate changing the Swing system colors (which you'll only have to do once (DRY)):