codice:
import javax.swing.*;
import java.awt.*;
public class applet extends JApplet{
String metal="javax.swing.plaf.metal.MetalLookAndFeel";
String windows="com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
String motif="com.sun.java.swing.plaf.motif.MotifLookAndFeel";
public void init(){
Container cont=this;
setLef(motif,cont);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(new JButton("PREMI QUI"),BorderLayout.NORTH);
getContentPane().add(new JLabel("CIAO MONDO"),BorderLayout.CENTER);
getContentPane().add(new JTextField(),BorderLayout.SOUTH);
}
private void setLef(String lef,Container v){
try{
UIManager.setLookAndFeel(lef);
SwingUtilities.updateComponentTreeUI(v);
}catch(Exception e){}
}
}
Ciauz