+ setTitle("Note properties");
+
+ pitch = new JTextField(new Integer(note.getPitch()).toString(),3);
+ JPanel pitchpanel = new JPanel();
+ pitchpanel.add(new Label("Pitch: "));
+ pitchpanel.add(pitch);
+
+
+ velocity = new JTextField(new Integer(note.getVelocity()).toString(),3);
+ JPanel velocitypanel = new JPanel();
+ velocitypanel.add(new Label("Velocity: "));
+ velocitypanel.add(velocity);
+
+ length = new JTextField(new Integer(note.getDuration()).toString(),5);
+ JPanel lengthpanel = new JPanel();
+ lengthpanel.add(new Label("Length: "));
+ lengthpanel.add(length);
+
+ Object[] array = {"Set the note properties",
+ pitchpanel,
+ velocitypanel,
+ lengthpanel};
+
+ final String btnString1 = "Enter";
+ final String btnString2 = "Cancel";
+ Object[] options = {btnString1, btnString2};
+
+ optionPane = new JOptionPane(array,
+ JOptionPane.QUESTION_MESSAGE,
+ JOptionPane.YES_NO_OPTION,
+ null,
+ options,
+ options[0]);
+ setContentPane(optionPane);
+ setDefaultCloseOperation(EXIT_ON_CLOSE);
+/*
+ textField.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ optionPane.setValue(btnString1);
+ }
+ });
+*/
+ optionPane.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent e) {
+ String prop = e.getPropertyName();