Guest User

telefoneJAVAFXARDUINO

a guest
Feb 8th, 2018
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.60 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.ListView;
  17. import javafx.scene.control.TextField;
  18. import javafx.scene.layout.HBox;
  19. import javafx.scene.layout.StackPane;
  20. import javafx.scene.layout.VBox;
  21. import javafx.scene.paint.Color;
  22. import javafx.scene.text.Text;
  23. import javafx.stage.Stage;
  24.  
  25. /**
  26.  *
  27.  * @author msk kml
  28.  /*      
  29.  vb----  
  30.        hb1------
  31.                 vb1---
  32.                         txtitulo,txtnome,tfnome,txttelefone,tftelefone,txtemail,tfemail,txtinofrmaçoes,tfinfo,
  33.                              ... hb
  34.                                      ---buton salvar, buton editar
  35.                                              
  36.                 vb2 -----
  37.                         listview, hb----
  38.                                     buton DELETE,email,Sms,ligar,
  39.        
  40.        hb2-----
  41.                button imageATENDER,Buton IMAGE DISCAR,Buton IMAGESMS's
  42.        
  43.    */
  44.  
  45. public class Agenda_InoFX extends Application {
  46.    
  47.     @Override
  48.     public void start(Stage stage) {
  49.        
  50.         Group gp=new Group ();
  51.         Scene scene=new Scene (gp,400,400, Color.ALICEBLUE);
  52.         stage.setScene(scene);
  53.        
  54.         VBox vboxPrimeiro=new VBox(10);
  55.         gp.getChildren().add(vboxPrimeiro);
  56.        
  57.                 HBox hb1=new HBox(5);
  58.         vboxPrimeiro.layoutXProperty().bind(scene.widthProperty().divide(6).subtract(20));
  59.        vboxPrimeiro.layoutYProperty().bind(scene.heightProperty().divide(6).subtract(15));        VBox vb1=new VBox();
  60.                      
  61.                             Text txTitle=new Text("Agenda telefonica JFX");
  62.                             Text txNome=new Text("Nome");
  63.                            TextField tfnome=new TextField();
  64.                            
  65.                             Text txtelefone=new Text("Telefone");
  66.                            TextField tftelefone=new TextField();
  67.                             Text txemail=new Text("Email");
  68.                               TextField tfemail=new TextField();
  69.                             Text txInfo=new Text("Informaçoes");
  70.                               TextField tfinfo=new TextField();                
  71.                                 HBox hbbt_info =new HBox(5);
  72.          
  73.                                 vb1.getChildren().addAll(
  74.                                          txTitle,txNome,tfnome,
  75.                                          txtelefone,tftelefone,
  76.                                           txemail,tfemail,txInfo,tfinfo
  77.                                         ,hbbt_info
  78.           );
  79.                                 Button btSave=new Button("salvar");
  80.                                 Button btEditar=new Button("Editar");
  81.                       hbbt_info.getChildren().addAll(btSave,btEditar);
  82.                                
  83.                 VBox vb2=new VBox();
  84.         //funçoes so serao validaas se um contato for adcionado no button
  85.              ObservableList<String> names = FXCollections.observableArrayList(
  86.           "Julia", "Ian", "Sue", "Matthew", "Hannah", "Stephan", "Denise");
  87.            ListView<String> listView = new ListView<String>(names);
  88.                  listView.setPrefSize(100, 180);
  89.            HBox hbinfbutns=new HBox(5);
  90.                
  91.                 Button btDel=new Button("DEL");
  92.                 Button btemail=new Button("Email");
  93.                 Button Btsms=new Button("SMS");
  94.                 Button Btligar=new Button("Ligar");
  95.        hbinfbutns.getChildren().addAll(btDel,btemail,Btsms,Btligar);
  96.        vb2.getChildren().addAll(listView,hbinfbutns);  
  97.                 hb1.getChildren().addAll(vb1,vb2);
  98.                
  99.                 HBox hb2=new HBox();
  100.                
  101.                 Button btAtende=new Button("Atender");
  102.                 Button btDisca=new Button("DIscar");
  103.                 Button BtListSms=new Button("SMS's");
  104.        hb2.getChildren().addAll(btAtende,btDisca,BtListSms);
  105.        
  106. vboxPrimeiro.getChildren().addAll(hb1,hb2);
  107.        stage.show();
  108.     }
  109.  
  110.     /**
  111.      * @param args the command line arguments
  112.      */
  113.     public static void main(String[] args) {
  114.         launch(args);
  115.     }
  116.    
  117. }
  118.  bem10jfx.blogspot.com.br
  119. mkls
Advertisement
Add Comment
Please, Sign In to add comment