Implement JavaFX music player features
This commit is contained in:
@@ -1,8 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<VBox xmlns="http://javafx.com/fxml" alignment="CENTER" spacing="10">
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<VBox xmlns="http://javafx.com/javafx/17"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="sbu.javafx.MusicController"
|
||||
alignment="TOP_CENTER"
|
||||
spacing="15"
|
||||
prefWidth="400"
|
||||
prefHeight="500">
|
||||
|
||||
<!-- TODO: Add your code here! -->
|
||||
<padding>
|
||||
<Insets top="20" right="20" bottom="20" left="20"/>
|
||||
</padding>
|
||||
|
||||
<Label text="Music Player"
|
||||
style="-fx-font-size:24px; -fx-font-weight:bold;"/>
|
||||
|
||||
<Label fx:id="nowPlayingLabel"
|
||||
text="Now Playing : None"
|
||||
style="-fx-font-size:16px;"/>
|
||||
|
||||
<!-- Song 1 -->
|
||||
<HBox spacing="10" alignment="CENTER_LEFT">
|
||||
|
||||
<VBox spacing="3">
|
||||
<Label text="Shape Of You"/>
|
||||
<Label text="Ed Sheeran"/>
|
||||
<Label text="3:55"/>
|
||||
</VBox>
|
||||
|
||||
<Button text="Play"
|
||||
onAction="#handlePlayAction"
|
||||
userData="Shape Of You"/>
|
||||
|
||||
<Button text="Add to Playlist"
|
||||
onAction="#addSong1"/>
|
||||
</HBox>
|
||||
|
||||
<!-- Song 2 -->
|
||||
<HBox spacing="10" alignment="CENTER_LEFT">
|
||||
|
||||
<VBox spacing="3">
|
||||
<Label text="Believer"/>
|
||||
<Label text="Imagine Dragons"/>
|
||||
<Label text="3:24"/>
|
||||
</VBox>
|
||||
|
||||
<Button text="Play"
|
||||
onAction="#handlePlayAction"
|
||||
userData="Believer"/>
|
||||
|
||||
<Button text="Add to Playlist"
|
||||
onAction="#addSong2"/>
|
||||
</HBox>
|
||||
|
||||
<!-- Song 3 -->
|
||||
<HBox spacing="10" alignment="CENTER_LEFT">
|
||||
|
||||
<VBox spacing="3">
|
||||
<Label text="Perfect"/>
|
||||
<Label text="Ed Sheeran"/>
|
||||
<Label text="4:21"/>
|
||||
</VBox>
|
||||
|
||||
<Button text="Play"
|
||||
onAction="#handlePlayAction"
|
||||
userData="Perfect"/>
|
||||
|
||||
<Button text="Add to Playlist"
|
||||
onAction="#addSong3"/>
|
||||
</HBox>
|
||||
|
||||
<Button text="View Playlist"
|
||||
onAction="#openPlaylistWindow"/>
|
||||
|
||||
</VBox>
|
||||
|
||||
Reference in New Issue
Block a user