Reinilton Posted April 9, 2015 at 03:41 AM Report Share #580936 Posted April 9, 2015 at 03:41 AM (edited) Já descobri como recuperar a variável e o texto do botão: botao1 = new Button("Fechar"); botao1.setName("meuBotao3"); public void actionPerformed(ActionEvent e) { if(e.getSource()==botao1){ System.out.println("variável do botão: botao1"); } System.out.println("Texto do botão: "+e.getActionCommand()); } Agora quero saber como recuperar o nome que eu setei no mesmo? Edited April 9, 2015 at 09:36 AM by apocsantos geshi Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted April 9, 2015 at 03:54 AM Report Share #580937 Posted April 9, 2015 at 03:54 AM (edited) public void actionPerformed(ActionEvent e) { if(e.getSource() == botao1){ System.out.println("Nome do botão: " + botao1.getName()); } } Edited April 9, 2015 at 03:54 AM by HappyHippyHippo IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now