自定义标签 2023年4月24日18:00:58
parent
2b4a40e567
commit
289acf3636
|
|
@ -563,6 +563,22 @@ public class MusicController {
|
|||
listView.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, null, null)));
|
||||
listView.setFixedCellSize(40.0D);
|
||||
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() {
|
||||
|
|
|
|||
|
|
@ -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" />
|
||||
Loading…
Reference in New Issue