Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public class playlistAttr {
  2. private String nome;
  3. public static ArrayList<playlistAttr> playlist = new ArrayList<>();
  4.  
  5. public String getNome() {
  6. return this.nome;
  7. }
  8.  
  9. public void setNome(String nome) {
  10. this.nome = nome;
  11. }
  12.  
  13. public playlistAttr(String nome) {
  14. this.nome = nome;
  15. }
  16.  
  17.  
  18. public static void criarPlaylist(String nome_playlist){
  19. if (!nome_playlist.equals("")){
  20. playlistAttr criar = new playlistAttr(nome_playlist);
  21. playlist.add(criar);
  22. JOptionPane.showMessageDialog(null,"Playlist criada com sucesso!!!");
  23. }
  24. }
  25.  
  26. public static void setPlaylistComboBox(JComboBox recebe){
  27. for (int i = 0; i < playlist.size(); i++) {
  28. recebe.addItem(playlist.get(i).getNome());
  29. }
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement