Как сменить цвет формы, когда я во вслывающем меню выбираю какой-нибудь Item?
public void actionPerformed(ActionEvent e) { if (e.getSource() == pm.getItem(0)) f.setBackground(Color.red); if (e.getSource() == pm.getItem(1)) f.setBackground(Color.green); if (e.getSource() == pm.getItem(2)) f.setBackground(Color.blue); } public static void main(String argumendid[]) { Frame f=new Frame("Calculation"); f.setSize(200, 200); f.setVisible(true); }