implement App-view.fxml

This commit is contained in:
2026-05-24 11:29:51 +03:30
parent 19430799c6
commit 65b7bff1f2
3 changed files with 34 additions and 12 deletions
@@ -17,9 +17,15 @@ public class MusicController {
//Update labels, change button icons, etc. //Update labels, change button icons, etc.
} }
//TODO: Logic to add a specific song to the user's playlist. @FXML
public void handlePrevious() {}
public void addToPlaylist(String songName) { @FXML
public void handlenext() {}
//TODO: Logic to add a specific song to the user's playlist.
@FXML
public void addToPlaylist() {
//Add the song to a list or update a ListView. //Add the song to a list or update a ListView.
} }
@@ -1,13 +1,11 @@
package sbu.javafx; package sbu.javafx;
import java.io.File; public class Song {
public class song {
private String songName; private String songName;
private String artist; private String artist;
private String songAddress; private String songAddress;
public song(String songName, String artist, String songAddress) { public Song(String songName, String artist, String songAddress) {
this.songName = songName; this.songName = songName;
this.artist = artist; this.artist = artist;
this.songAddress = songAddress; this.songAddress = songAddress;
+24 -6
View File
@@ -1,8 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.control.ListView?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<BorderPane
xmlns:fx="http//javafx.com/fxml"
fx:controller="sbu.javafx.MusicController">
<center>
<ListView fx:id="musicListView">
<padding>
<Insets top="10" right="10" bottom="10" left="10"/>
</padding>
</ListView>
</center>
<?import javafx.scene.layout.VBox?> <bottom>
<VBox xmlns="http://javafx.com/fxml" alignment="CENTER" spacing="10"> <HBox spacing="10" alignment="CENTER">
<Button text="Previous" onAction="#handlePrevious"/>
<Button text="Play/Pause" onAction="#handlePlayAction"/>
<Button text="Next" onAction="#handlenext"/>
<Button text="add to playlist" onAction="#addToPlaylist"/>
</HBox>
</bottom>
</BorderPane>
<!-- TODO: Add your code here! -->
</VBox>