Added remove and edit capability.
This commit is contained in:
+15
-3
@@ -22,7 +22,7 @@ public class AddArtistPanel extends JFrame{
|
||||
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||
JPanel content = new JPanel(new BorderLayout());
|
||||
JPanel south = new JPanel(new FlowLayout());
|
||||
JPanel center = new JPanel(new GridLayout(4,2));
|
||||
JPanel center = new JPanel(new GridLayout(5,2));
|
||||
content.add(south, BorderLayout.SOUTH);
|
||||
content.add(center, BorderLayout.CENTER);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class AddArtistPanel extends JFrame{
|
||||
center.add(panel5);
|
||||
|
||||
JPanel panel6 = new JPanel();
|
||||
JTextField imageTF = new JTextField("", 15);
|
||||
JTextField imageTF = new JTextField("null", 15);
|
||||
panel6.add(imageTF);
|
||||
center.add(panel6);
|
||||
|
||||
@@ -65,6 +65,16 @@ public class AddArtistPanel extends JFrame{
|
||||
JTextField descriptionTF = new JTextField("", 15);
|
||||
panel8.add(descriptionTF);
|
||||
center.add(panel8);
|
||||
|
||||
JPanel panel9 = new JPanel();
|
||||
JLabel background = new JLabel("Background: ");
|
||||
panel9.add(background);
|
||||
center.add(panel9);
|
||||
|
||||
JPanel panel10 = new JPanel();
|
||||
JTextField backgroundTF = new JTextField("", 15);
|
||||
panel10.add(backgroundTF);
|
||||
center.add(panel10);
|
||||
|
||||
|
||||
|
||||
@@ -78,6 +88,7 @@ public class AddArtistPanel extends JFrame{
|
||||
String genre = genreTF.getText();
|
||||
String image = imageTF.getText();
|
||||
String description = descriptionTF.getText();
|
||||
String background = backgroundTF.getText();
|
||||
|
||||
boolean alreadyExists = false;
|
||||
for (Artist artist : agenda.getArtists())
|
||||
@@ -92,11 +103,12 @@ public class AddArtistPanel extends JFrame{
|
||||
}
|
||||
else if (alreadyExists == false)
|
||||
{
|
||||
Artist a = new Artist(name,genre,image,description, description);
|
||||
Artist a = new Artist(name,genre,image,description, background);
|
||||
agenda.addArtist(a);
|
||||
JOptionPane.showMessageDialog(null, "Artist added!");
|
||||
setVisible(false);
|
||||
dispose();
|
||||
Window.updatePanel("art_sta");
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null, "Choose a different artist name!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user