@@ -16,15 +16,19 @@ public void start(Stage primaryStage) {
16
16
Button btn1 =new Button ("Color 1" );
17
17
Button btn2 =new Button ("Color 2" );
18
18
Button btn3 =new Button ("Color 3" );
19
- Text txt = new Text ("" );
19
+ Text txt = new Text ();
20
+ Text txt2 = new Text ("Suma de colores:" +"\n " +"Instrucciones: Conforme le da click a un boton correspondiente,"
21
+ + "\n " +" estos se sumaran constantemente."
22
+ +"\n " +"Los valores son: " +"\n " +"Color 1: 10" +"\n " +"Color 2: 20" +"\n " +"Color 3: 30" );
23
+ Text txt3 = new Text ("Resultado" );
20
24
HBox root =new HBox ();
21
- customize (btn1 ,btn2 ,btn3 ,txt ,root ,gp );
22
- Scene scene = new Scene (gp ,300 , 400 );
25
+ customize (btn1 ,btn2 ,btn3 ,txt ,txt2 , txt3 , root ,gp );
26
+ Scene scene = new Scene (gp ,400 , 500 );
23
27
primaryStage .setScene (scene );
24
28
primaryStage .show ();
25
29
}
26
30
27
- private void customize (Button btn1 ,Button btn2 ,Button btn3 ,Text txt , HBox root ,GridPane gp ) {
31
+ private void customize (Button btn1 ,Button btn2 ,Button btn3 ,Text txt , Text txt2 , Text txt3 , HBox root ,GridPane gp ) {
28
32
btn1 .setOnAction (event -> {color1 (gp , txt );
29
33
o .sumar1 ();
30
34
acuse .setText (o .getnumero ()+"" );
@@ -43,7 +47,9 @@ private void customize(Button btn1,Button btn2,Button btn3,Text txt, HBox root,G
43
47
root .getChildren ().addAll (btn1 ,btn2 ,btn3 );
44
48
gp .add (root , 0 ,0 );
45
49
gp .add (txt , 0 , 1 );
46
- gp .add (acuse ,0 ,2 );
50
+ gp .add (txt2 , 0 , 2 );
51
+ gp .add (txt3 ,0 ,3 );
52
+ gp .add (acuse ,0 ,4 );
47
53
}
48
54
49
55
public void color1 (GridPane root ,Text txt ) {
0 commit comments