Fórum Inserir uma imagem dentro de um botão? #516912
15/04/2015
0
Como inserir uma imagem dentro de um botão?

Reinilton
Curtir tópico
+ 0
Responder
Post mais votado
15/04/2015
Pode ser feito de várias formas, vou enumerar algumas.
Css:
HTML:
HTML:
Css:
1 2 3 4 5 6 7 | Informa seu nome: < input type = "text" name = "texto" > < input type = image src = "images/enter.gif" width = "25" height = "15" > </ form > |
Css:
1 2 3 | .botao { background-image:url("caminho-da-imagem"); } |
HTML:
1 | < input type = "button" class = "botao" > |
HTML:
1 | < input type = "submit" value = "Subscribe" > |
Css:
1 2 3 4 5 6 | input[type=submit] { background:url(../images/btn-subscribe.gif) none; text-indent:-9999px; width:109px; height:41px; } |
Jothaz

Responder
Gostei + 1
Mais Posts
15/04/2015
Reinilton
Obrigado pela atenção mas eu quero saber em Java.
Responder
Gostei + 0
15/04/2015
Ronaldo Lanhellas
Como inserir uma imagem dentro de um botão?
Tente assim:
1 2 3 4 5 6 | JButton button = new JButton(); try { Image img = ImageIO.read(getClass().getResource("resources/imagem.bmp")); button.setIcon(new ImageIcon(img)); } catch (IOException ex) { } |
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)