2017-01-10 1 views
0

私はControlsFX通知を使用してメッセージのグループを表示しています。テキストは私にとって完璧な方法ではないので、私はTableViewでデータを提示します。通常の場合にはControlsFX通知グラフィックが壊れています

import org.controlsfx.control.Notifications; 
...... 


TableView<NotificationModel> notificationTable = new TableView(); 

...... 

Notifications notification = Notifications.create() 
      .title("Transaction Notifications") 
      .text(null) 
      .graphic(notificationTable) 
      .position(Pos.BOTTOM_RIGHT) 
      .hideAfter(Duration.minutes(1)); 

notification.show(); 

、通知は次のようになります。

Notification - OK

しかし、通知は以下のように、ほとんどの時間を破損して表示されます。お互いにオーバーレイする> 1の通知を表示しているようです。

Notification - corrupted

は、私が ":トータル・交換用グラフィックスグラフィックスオプション" を選択し、ControlsFXサンプルjarファイルをテストしました。同じ破損した動作を示します。

Notification - Corrupted

グラフィックスとテキスト以外の通知を表示するときには、ControlsFXからのバグのように見えます。誰も同様の問題に直面している?私はmacOS Sierra 10.12.2、ControlsFX 8.40.12で開発しています。

答えて

0

AnchorPaneでTableViewをラップし、Notificationsのグラフィックとして設定して問題を解決しました。

AnchorPane anchorPane = new AnchorPane(notificationTable); 

    Notifications notification = Notifications.create() 
      .title("Transaction Notifications") 
      .text(null) 
      .graphic(anchorPane) 
      .position(Pos.BOTTOM_RIGHT) 
      .hideAfter(Duration.minutes(1)); 

    notification.show(); 

私はここからヒントを得た:ControlsFX Issue Tracker

関連する問題