自定义标签 2023年4月24日18:00:58

master
zhangmeng 2023-04-24 18:12:21 +08:00
parent 2b4a40e567
commit 289acf3636
2 changed files with 22 additions and 0 deletions

View File

@ -563,6 +563,22 @@ public class MusicController {
listView.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, null, null))); listView.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, null, null)));
listView.setFixedCellSize(40.0D); listView.setFixedCellSize(40.0D);
list_cell(); list_cell();
MenuItem mi1 = new MenuItem("搜索");
mi1.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
Stage primaryStage = (Stage) MusicController.this.listView.getScene().getWindow();
AnchorPane root = null;
try {
root = FXMLLoader.load(ResourcesUtils.getResource("music-search"));
} catch (IOException e) {
e.printStackTrace();
}
AlertUtils.alert("设置", root, primaryStage);
}
});
ContextMenu cm = new ContextMenu(mi1);
} }
private void list_cell() { private void list_cell() {

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane prefHeight="649.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" />