document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import javafx.scene.layout.*;
  2. import javafx.scene.text.Font;
  3. import javafx.scene.text.Text;
  4. import javafx.stage.Stage;
  5. import javafx.geometry.Insets;
  6. import javafx.geometry.Pos;
  7. import javafx.scene.Scene;
  8. import javafx.scene.control.*;
  9. import javafx.scene.layout.StackPane;
  10. import javafx.collections.*;
  11. import javafx.scene.paint.*;
  12. import javafx.scene.text.*;
  13. import javafx.scene.Group;
  14. import java.util.Random;
  15. import javafx.application.Application;
  16. import javafx.application.Platform;
  17. import javafx.event.ActionEvent;
  18. import javafx.event.EventHandler;
  19.  
  20. public class Cetak
  21. {
  22.     private Text NamaBarang = new Text(""), TotalHargaText = new Text("");
  23.     private String jumlahBeli;
  24.     public Cetak(Text namaBarang, String jumlah, Text TotalHarga)
  25.     {
  26.        
  27.         NamaBarang = namaBarang;
  28.         TotalHargaText = TotalHarga;
  29.         jumlahBeli = jumlah;
  30.     }
  31.     public void showCetak()
  32.     {
  33.        Stage stage = new Stage();
  34.        Scene scene = new Scene(new Group(), 700, 350);
  35.        stage.setTitle("Nota");
  36.        
  37.        GridPane grid = new GridPane();
  38.        grid.setVgap(20);
  39.        grid.setHgap(35);
  40.        grid.setPadding(new Insets(10, 10, 10, 10));
  41.        grid.add(new Label("Pembelian"),0,0);
  42.        grid.add(NamaBarang,0,1);
  43.        grid.add(new Label(jumlahBeli),1,1);
  44.        grid.add(new Label("Harga"),0,2);
  45.        
  46.        grid.add(TotalHargaText,1,2);
  47.        
  48.        Group root = (Group)scene.getRoot();
  49.        root.getChildren().add(grid);
  50.        stage.setScene(scene);
  51.        stage.show();
  52.     }
  53.    
  54. }
');