Advertisement
stevennathaniel

JavaFX : Membuat Window Sederhana

Apr 19th, 2016
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package latihan3;
  7.  
  8. import javafx.application.Application;
  9. import static javafx.application.Application.launch;
  10.  
  11.  
  12. import javafx.event.ActionEvent;
  13.  
  14. import javafx.event.EventHandler;
  15.  
  16. import javafx.geometry.Insets;
  17.  
  18.  
  19. import javafx.geometry.Pos;
  20.  
  21. import javafx.scene.Scene;
  22.  
  23. import javafx.scene.control.Button;
  24.  
  25. import javafx.scene.control.Label;
  26.  
  27. import javafx.scene.control.TextField;
  28.  
  29. import javafx.scene.layout.GridPane;
  30.  
  31. import javafx.scene.layout.HBox;
  32.  
  33. import javafx.scene.layout.StackPane;
  34.  
  35. import javafx.scene.text.Font;
  36.  
  37. import javafx.scene.text.FontWeight;
  38.  
  39. import javafx.scene.text.Text;
  40.  
  41. import javafx.stage.Stage;
  42. /**
  43.  *
  44.  * @author stevennathaniel
  45.  */
  46. public class jendela1 extends Application{
  47.    
  48.    
  49.     public void start(Stage primaryStage){
  50.        
  51.         primaryStage.setTitle("Kalkulator Pajak JavaFX");
  52.        
  53.         GridPane pane = new GridPane();
  54.        
  55.         pane.setAlignment(Pos.CENTER);
  56.        
  57.         pane.setHgap(10);
  58.        
  59.         pane.setVgap(10);
  60.        
  61.         pane.setPadding(new Insets(25,25,25,25));
  62.        
  63.         Scene scene = new Scene(pane, 300, 275);
  64.        
  65.        
  66.         primaryStage.setScene(scene);
  67.        
  68.         primaryStage.show();
  69.        
  70.        
  71.     }
  72.    
  73.     public static void main(String[]args){
  74.        
  75.         launch(args);
  76.     }
  77.    
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement