Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. public class TableMatchHistory
  2. {
  3. private ImageView Radiant;
  4. private ImageView Dire;
  5. public TableMatchHistory(ImageView Radiant,ImageView Dire)
  6. {
  7. this.Radiant = Radiant;
  8. this.Dire = Dire;
  9.  
  10. }
  11. public TableMatchHistory() {}
  12.  
  13. public ImageView getRadiant()
  14. {
  15. return Radiant;
  16. }
  17. public void setRadiant(ImageView Radiant)
  18. {
  19. this.Radiant = Radiant;
  20. }
  21.  
  22. public ImageView getDire()
  23. {
  24. return Dire;
  25. }
  26. public void setDire(ImageView Dire)
  27. {
  28. this.Dire = Dire;
  29. }
  30.  
  31. }
  32.  
  33. public class Controller
  34. {
  35. private ObservableList<TableMatchHistory> MatchHistoryData =
  36. FXCollections.observableArrayList();
  37.  
  38. @FXML
  39. TableView TableMatchHistory;
  40.  
  41. @FXML
  42. private void initialize(){
  43. ImageView item_1 = new ImageView(new Image("/dota2-images-gh-pages/heroes_sb_59_33/abaddon_sb.png"));
  44. ImageView item_2 = new ImageView(new Image("/dota2-images-gh-pages/heroes_sb_59_33/alchemist_sb.png"));
  45.  
  46. TableColumn Radiant = new TableColumn("Radiant");
  47. TableColumn Dire = new TableColumn("Dire");
  48.  
  49. Radiant.setCellValueFactory(new PropertyValueFactory<TableMatchHistory, ImageView>("Radiant"));
  50. Dire.setCellValueFactory(new PropertyValueFactory<TableMatchHistory, ImageView>("Dire"));
  51.  
  52. TableMatchHistory.setItems(MatchHistoryData);
  53. TableMatchHistory.getColumns().addAll(Radiant, Dire);
  54. MatchHistoryData.add(new TableMatchHistory(item_1, item_2));
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement