import java.awt.*;
dbox = javax.swing.JFrame('Swing sample script for MATLAB 6');
dbox2=dbox.getContentPane;
dbox2.setLayout(FlowLayout);
dbox.setLocation(50,50);
%resize(dbox,400,400);
slabel=javax.swing.JLabel('Swing Label');
dbox2.add(slabel);

sbuttongrp=javax.swing.ButtonGroup;
sbutton1=javax.swing.JRadioButton('Metal');
sbutton2=javax.swing.JRadioButton('Window');
sbutton3=javax.swing.JRadioButton('Motif');
sbuttongrp.add(sbutton1);
sbuttongrp.add(sbutton2);
sbuttongrp.add(sbutton3);
dbox2.add(sbutton1);
dbox2.add(sbutton2);
dbox2.add(sbutton3);

sbutton2.setSelected(1);
javax.swing.UIManager.setLookAndFeel('com.sun.java.swing.plaf.windows.WindowsLookAndFeel');
set(sbutton1,'ActionPerformedCallback',...
['dbox.hide;',...
 'javax.swing.UIManager.setLookAndFeel(''javax.swing.plaf.metal.MetalLookAndFeel'');',...
 'javax.swing.SwingUtilities.updateComponentTreeUI(dbox);',...
 'dbox.pack;dbox.show;']);
set(sbutton2,'ActionPerformedCallback',...
['dbox.hide;',...
 'javax.swing.UIManager.setLookAndFeel(''com.sun.java.swing.plaf.windows.WindowsLookAndFeel'');',...
 'javax.swing.SwingUtilities.updateComponentTreeUI(dbox);'...
 'dbox.pack;dbox.show;']);
set(sbutton3,'ActionPerformedCallback',...
['dbox.hide;',...
 'javax.swing.UIManager.setLookAndFeel(''com.sun.java.swing.plaf.motif.MotifLookAndFeel'');',...
 'javax.swing.SwingUtilities.updateComponentTreeUI(dbox);',...
 'dbox.pack;dbox.show;']);

scheckbx=javax.swing.JCheckBox('Swing CheckBox');
dbox2.add(scheckbx);
set(scheckbx,'ActionPerformedCallback',...
'disp([''CheckBox '' num2str(scheckbx.isSelected)]);');

data = {'data1', 'data2', 'data3'};

slist =javax.swing.JList(data);
dbox2.add(slist);
set(slist,'MouseClickedCallback',...
'disp([''List box'' char(data(slist.getSelectedIndex+1))]);');

scombo=javax.swing.JComboBox(data); 
dbox2.add(scombo);
set(scombo,'ActionPerformedCallback',...
'disp([''Combo box'' char(data(scombo.getSelectedIndex+1))]);');

sbutton=javax.swing.JButton('Swing Button to Quit');
dbox2.add(sbutton);
set(sbutton,'MouseClickedCallback','dbox.dispose');

javax.swing.SwingUtilities.updateComponentTreeUI(dbox)
dbox.pack;
dbox.show;
