亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在Javafx中組合字符來創建圖標?

如何在Javafx中組合字符來創建圖標?

qq_遁去的一_1 2023-07-28 16:14:44
在 Windows 中,您可以組合字符來構建圖標:有一些合理的方法可以重寫它。單程:public List<String> noZ(List<String> strings) {? ? List<String> out = new ArrayList<>();? ? for (String s : strings) {? ? ? ? if (!s.contains("z")) {? ? ? ? ? ? out.add(s);? ? ? ? }? ? }? ? return out;}
查看完整描述

1 回答

?
慕慕森

TA貢獻1856條經驗 獲得超17個贊

為了演示它,我使用這兩個圖像:

https://img1.sycdn.imooc.com//64c3791b000133ac01690087.jpg

構造一個如下所示的按鈕:

https://img1.sycdn.imooc.com//64c3792a0001f09401250117.jpg

堆疊圖像并用作按鈕的圖形節點:


private static final String[] images = {

        "https://i.imgur.com/g52UeNO.png",

        "https://i.imgur.com/kvHOLJ4.jpg",

};


ImageView imageView1 = new ImageView(images[0]);

ImageView imageView2 = new ImageView(images[1]);

StackPane sp = new StackPane(imageView1, imageView2);

Button button = new Button("", sp);

編輯:要堆疊字符,請使用:


Text t1 = new Text(Character.toString('O'));

t1.setFont(Font.font ("Verdana", 20));

t1.setFill(Color.RED);

Text t2 = new Text(Character.toString('x'));

t2.setFont(Font.font ("Verdana", 12));

t1.setFill(Color.BLUE);

StackPane sp = new StackPane(t1, t2);

Button button = new Button("", sp);


查看完整回答
反對 回復 2023-07-28
  • 1 回答
  • 0 關注
  • 135 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號