Пожалуйста, помогите мне разобраться, что здесь происходит не так?только начинается в Java.
public class PropertyChangeListenerTest {
private JPanel mainPanel = null;
private JTextField source = null;
private JTextField target = null;
PropertyChangeListenerTest() {
mainPanel = new JPanel();
mainPanel.setLayout(new GridLayout(1, 0, 10, 0));
source = new JTextField(20);
target = new JTextField(20);
mainPanel.add(source);
mainPanel.add(target);
}
JPanel getMainPanel() {
return mainPanel;
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
createAndShowGUI();
}
});
}
protected static void createAndShowGUI() {
JFrame f = new JFrame("PropertyChangeListener");
f.getContentPane().add(new PropertyChangeListenerTest().getMainPanel());
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
}