Call a new screen using a button (Scene Builder, Javafx)

Asked

Viewed 195 times

-3

I created two screens, one main and one that I intend to call using a button, as it would be the appropriate method to call this secondary screen?

1 answer

0

findViewById(R.id.botao).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent variavel = new Intent(context, classeSegundaTela.class);
                startActivity(variavel);
            }
        });

Browser other questions tagged

You are not signed in. Login or sign up in order to post.