I created the basic UI of the music player.
This commit is contained in:
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -2,7 +2,13 @@ package sbu.javafx;
|
||||
|
||||
import javafx.application.Application;
|
||||
|
||||
public class Launcher{
|
||||
public class Launcher {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO: Launch the JavaFX application by calling Application.launch(Main.class) }
|
||||
|
||||
Application.launch(MusicApp.class ,args);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public class MusicApp extends Application {
|
||||
Scene scene = new Scene(fxmlLoader.load());
|
||||
stage.setTitle("Music Player");
|
||||
stage.setScene(scene);
|
||||
|
||||
//TODO: add icon to the stage
|
||||
stage.show();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package sbu.javafx;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.VBox;
|
||||
@@ -12,6 +13,11 @@ public class MusicController {
|
||||
|
||||
//TODO: Implement the logic to play a song. This method should update the UI to show which song is currently playing.
|
||||
|
||||
public Button button ;
|
||||
public void OnAction()
|
||||
{
|
||||
System.out.println("click on submit");
|
||||
}
|
||||
@FXML
|
||||
public void handlePlayAction() {
|
||||
//Update labels, change button icons, etc.
|
||||
|
||||
@@ -1,8 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<VBox xmlns="http://javafx.com/fxml" alignment="CENTER" spacing="10">
|
||||
<?import javafx.scene.shape.Rectangle?>
|
||||
|
||||
<VBox alignment="CENTER" xmlns="http://javafx.com/javafx/26" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<Label alignment="CENTER" prefHeight="23.0" prefWidth="576.0" text="Music Player">
|
||||
<font>
|
||||
<Font name="Mongolian Baiti" size="20.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<HBox prefHeight="0.0" prefWidth="578.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="54.0" prefWidth="577.0">
|
||||
<children>
|
||||
<Label layoutX="370.0" layoutY="8.0" prefHeight="18.0" prefWidth="86.0" text="Add To PlayList" />
|
||||
<Label layoutX="270.0" layoutY="8.0" text="Duration " />
|
||||
<Label layoutX="523.0" layoutY="8.0" text="play" />
|
||||
<Label layoutX="148.0" layoutY="8.0" prefHeight="18.0" prefWidth="74.0" text="Artist Name" />
|
||||
<Label layoutX="43.0" layoutY="8.0" text="Song Title" />
|
||||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#ffffff00" height="34.0" layoutX="7.0" stroke="BLACK" strokeType="INSIDE" width="567.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox prefHeight="64.0" prefWidth="578.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="65.0" prefWidth="578.0">
|
||||
<children>
|
||||
<Label layoutX="32.0" layoutY="23.0" text="Song of Dawn" />
|
||||
<Label layoutX="169.0" layoutY="23.0" text="Alice" />
|
||||
<Label layoutX="376.0" layoutY="23.0" text="Add To Playlist" />
|
||||
<Label layoutX="275.0" layoutY="23.0" text="03:45" />
|
||||
<Label layoutX="524.0" layoutY="23.0" text="Play" />
|
||||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#1f93ff00" height="48.0" layoutX="7.0" layoutY="8.0" stroke="BLACK" strokeType="INSIDE" width="567.0" />
|
||||
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
<HBox prefHeight="64.0" prefWidth="578.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="65.0" prefWidth="578.0">
|
||||
<children>
|
||||
<Label layoutX="32.0" layoutY="23.0" text="Night Drive" />
|
||||
<Label layoutX="169.0" layoutY="23.0" text="John" />
|
||||
<Label layoutX="376.0" layoutY="23.0" text="Add To Playlist" />
|
||||
<Label layoutX="275.0" layoutY="23.0" text="04:12" />
|
||||
<Label layoutX="524.0" layoutY="23.0" text="Play" />
|
||||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#1f93ff00" height="48.0" layoutX="7.0" layoutY="8.0" stroke="BLACK" strokeType="INSIDE" width="567.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox prefHeight="64.0" prefWidth="578.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="65.0" prefWidth="578.0">
|
||||
<children>
|
||||
<Label layoutX="32.0" layoutY="23.0" text="Lost Sky" />
|
||||
<Label layoutX="169.0" layoutY="23.0" text="Emma" />
|
||||
<Label layoutX="376.0" layoutY="23.0" text="Add To Playlist" />
|
||||
<Label layoutX="275.0" layoutY="23.0" text="02:55" />
|
||||
<Label layoutX="524.0" layoutY="23.0" text="Play" />
|
||||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#1f93ff00" height="48.0" layoutX="7.0" layoutY="8.0" stroke="BLACK" strokeType="INSIDE" width="567.0" />
|
||||
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
||||
<children>
|
||||
<Label layoutX="32.0" layoutY="50.0" text="Now Play :" />
|
||||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#ffffff00" height="64.0" layoutX="8.0" layoutY="27.0" stroke="BLACK" strokeType="INSIDE" width="567.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<!-- TODO: Add your code here! -->
|
||||
|
||||
</VBox>
|
||||
|
||||
Reference in New Issue
Block a user