packagecn.zbvc.java;importjava.awt.FlowLayout;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.UIManager;importjavax.swing.plaf.synth.SynthLookAndFeel;publicclassMyButton {
JFrame frame=newJFrame("Test Buttons");
JButton jButton=newJButton("JButton");//按钮publicMyButton() {
frame.setLayout(newFlowLayout());
frame.getContentPane().add(jButton);
}publicvoidshow() {
frame.pack();
frame.show();
}publicstaticvoidmain(String[] args) {
MyButton tb=newMyButton();
tb.show();
SynthLookAndFeel slf=newSynthLookAndFeel();try{
slf.load(MyButton.class.getResourceAsStream("mybutton.xml"), MyButton.class);
UIManager.setLookAndFeel(slf);
}catch(Exception e) {
e.printStackTrace();return;
}
}
}/**
*
*
**/