Guest User

telefone_media

a guest
Feb 9th, 2018
758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.04 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 agenda_inofx;
  7.  
  8. import javafx.application.Application;
  9. import javafx.collections.FXCollections;
  10. import javafx.collections.ObservableList;
  11. import javafx.event.ActionEvent;
  12. import javafx.event.EventHandler;
  13. import javafx.scene.Group;
  14. import javafx.scene.Scene;
  15. import javafx.scene.control.Button;
  16. import javafx.scene.control.Label;
  17. import javafx.scene.control.ListView;
  18. import javafx.scene.control.TextField;
  19. import javafx.scene.image.Image;
  20. import javafx.scene.image.ImageView;
  21. import javafx.scene.layout.HBox;
  22. import javafx.scene.layout.StackPane;
  23. import javafx.scene.layout.VBox;
  24. import javafx.scene.paint.Color;
  25. import javafx.scene.text.Text;
  26. import javafx.stage.Stage;
  27.  
  28. /**
  29.  *
  30.  * @author tina
  31.  /*      
  32.  vb----  
  33.        hb1------
  34.                 vb1---
  35.                         txtitulo,txtnome,tfnome,txttelefone,tftelefone,txtemail,tfemail,txtinofrmaçoes,tfinfo,
  36.                              ... hb
  37.                                      ---buton salvar, buton editar
  38.                                              
  39.                 vb2 -----
  40.                         listview, hb----
  41.                                     buton DELETE,email,Sms,ligar,
  42.        
  43.        hb2-----
  44.                button imageATENDER,Buton IMAGE DISCAR,Buton IMAGESMS's
  45.        
  46.    */
  47.  
  48. public class Agenda_InoFX extends Application {
  49.    
  50.     @Override
  51.     public void start(Stage stage) {
  52.        
  53.         Group gp=new Group ();
  54.         Scene scene=new Scene (gp,750,450, Color.ALICEBLUE);
  55.          stage.setScene(scene);
  56.         scene.getStylesheets().addAll(""+getClass().getResource("DarkTheme.css"));
  57.        
  58.      Image image = new Image(""+Agenda_InoFX.class.getResource("pexels.png"));
  59.  
  60.          // simple displays ImageView the image as is
  61.          ImageView iv1 = new ImageView();
  62.          iv1.setImage(image);
  63.          gp.getChildren().add(iv1);
  64.        
  65.        
  66.        
  67.         VBox vboxPrimeiro=new VBox(10);
  68.         vboxPrimeiro.setStyle("-fx-background-color:#000000;\n"
  69.                 + "    -fx-border-radius: 10;\n"
  70.                 + "    -fx-background-radius: 15;\n"
  71.                 + "    -fx-padding: 5;");
  72.         gp.getChildren().add(vboxPrimeiro);
  73.        
  74.                 HBox hb1=new HBox(5);
  75.         vboxPrimeiro.layoutXProperty().bind(scene.widthProperty().divide(6).subtract(20));
  76.        vboxPrimeiro.layoutYProperty().bind(scene.heightProperty().divide(6).subtract(15));        VBox vb1=new VBox();
  77.                      
  78.                            Label txTitle=new Label("Agenda telefonica JFX");
  79.                             Label txNome=new Label("Nome");
  80.                            TextField tfnome=new TextField();
  81.                            tfnome.setPromptText("nome");
  82.                            Label txtelefone=new Label("Telefone");
  83.                            TextField tftelefone=new TextField();
  84.                            tftelefone.setPromptText("Telefone");
  85.                            Label txemail=new Label("Email");
  86.                               TextField tfemail=new TextField();
  87.                               tfemail.setPromptText("Emamil");
  88.                             Label txInfo=new Label("Informaçoes");
  89.                               TextField tfinfo=new TextField();    
  90.                               tfinfo.setPromptText("INformaçoes");
  91.                                 HBox hbbt_info =new HBox(5);
  92.           vb1.setStyle("-fx-background-color:#696969;\n"
  93.                 + "    -fx-border-radius: 10;\n"
  94.                 + "    -fx-background-radius: 15;\n"
  95.                 + "    -fx-padding: 5;");
  96.                                 vb1.getChildren().addAll(
  97.                                          txTitle,txNome,tfnome,
  98.                                          txtelefone,tftelefone,
  99.                                           txemail,tfemail,txInfo,tfinfo
  100.                                         ,hbbt_info
  101.           );
  102.                                 Button btSave=new Button("salvar");
  103.                                 Button btEditar=new Button("Editar");
  104.                       hbbt_info.getChildren().addAll(btSave,btEditar);
  105.                        hbbt_info.setStyle("-fx-background-color:#000000;\n"
  106.                 + "    -fx-background-radius: 3;\n"
  107.                 + "    -fx-padding: 5;");      
  108.                 VBox vb2=new VBox();
  109.                
  110.                 vb2.setStyle("-fx-background-color:#696969;\n"
  111.                 + "    -fx-border-radius: 0px 20px 0px 20px;\n"
  112.                 + "    -fx-background-radius: 15;\n"
  113.                 + "    -fx-padding: 5;" );
  114.         //funçoes so serao validaas se um contato for adcionado no button
  115.              ObservableList<String> names = FXCollections.observableArrayList(
  116.           "Julia", "Ian", "Sue", "Matthew", "Hannah", "Stephan", "Denise");
  117.            ListView<String> listView = new ListView<String>(names);
  118.                  listView.setPrefSize(100, 180);
  119.            HBox hbinfbutns=new HBox(5);
  120.                
  121.                 Button btDel=new Button("DEL");
  122.                 Button btemail=new Button("Email");
  123.                 Button Btsms=new Button("SMS");
  124.                 Button Btligar=new Button("Ligar");
  125.        hbinfbutns.getChildren().addAll(btDel,btemail,Btsms,Btligar);
  126.        vb2.getChildren().addAll(listView,hbinfbutns);  
  127.                 hb1.getChildren().addAll(vb1,vb2);
  128.                
  129.                 HBox hb2=new HBox(10);
  130.                
  131.                 Button btAtende=new Button("Atender");
  132.                 Button btDisca=new Button("DIscar");
  133.                 Button BtListSms=new Button("SMS's");
  134.        hb2.getChildren().addAll(btAtende,btDisca,BtListSms);
  135.        
  136. vboxPrimeiro.getChildren().addAll(hb1,hb2);
  137.        stage.show();
  138.     }
  139.  
  140.     /**
  141.      * @param args the command line arguments
  142.      */
  143.     public static void main(String[] args) {
  144.         launch(args);
  145.     }
  146.    
  147. }
  148. bem10jfx.blogspot.com
Advertisement
Add Comment
Please, Sign In to add comment