Jaka jest różnica miedzy zapisem:
1. JButton btn1 = toolBar.add(actionNew);
a tym:
2. JButton btn1 = new JButton(actionNew);
toolBar.add(btn1);
???
przed wystepuje ta czesc kodu:
ImageIcon iconNew = new ImageIcon("file_new.png");
Action actionNew = new AbstractAction("New", iconNew) {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("new action");
}
};
jak napisane jest sposobem 1 to button jest w postaci ikonki ale nazwy juz nie ma
jak napisane jest sposobem 2 to buton jest w postaci ikonki ale obok jest napisane New
