POLITECHNIKA RZESZOWSKA - Wydział Elektrotechniki i Informatyki
u
public static void main(String[] args) {
AbstractActionDemo frame = new AbstractActionDemo(); frame.setTitle("AbstractActionDemo”); frame.setSize(300, 150);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true);
1 rs^i
) // End AbstractActionDemo
class MyOpenFileAction extends AbstractAction {
public MyOpenFileAction () { nr- im
super ("Open", new ImageIconCopen.gif"));
public void actionPer£ormed(ActionBvent e) {
Component comp = (Component)e.getSource(); ----
JFileChooser fileChooser = new JFileChooser (); __
fileChooser.showOpenDialog(comp);
JOptionPane dialog = new JOptionPane(); dialog.showMessageDialog(nuli, "Done !", —.—.
"Message", JOptionPane.INFORMATION_MESSAGE);
}
Copyright JtllJ Jan WUKUP—
} // End MyOpenFileAction /ilV Wykład b-