elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  Java
| | | |-+  Ayuda problema con Multiples Fuentes en Java
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Ayuda problema con Multiples Fuentes en Java  (Leído 1,742 veces)
Mario Olivera

Desconectado Desconectado

Mensajes: 108


Ser loco es pensar diferente.


Ver Perfil
Ayuda problema con Multiples Fuentes en Java
« en: 28 Noviembre 2015, 12:42 pm »

 Hola gente, que tal, hacia mucho no andaba por aquí, me encuentro con un problema en java, al trabajar con multiples fuentes, el problema es que no me aparecen los JButton, si bien si me aparecen estos se ven pero sin rellenar, solo el contorno en gris, espero me puedan ayudar

Saludos!

Código
  1. import javax.swing.JPanel;
  2. import javax.swing.JFrame;
  3. import java.awt.Color;
  4. import java.awt.FlowLayout;
  5. import java.awt.event.ActionEvent;
  6. import java.beans.PropertyChangeListener;
  7. import javax.swing.Action;
  8. import javax.swing.Icon;
  9. import javax.swing.ImageIcon;
  10. import javax.swing.JButton;
  11.  
  12.  
  13. public class principal {
  14.  
  15. public static void main(String[] args)
  16. {
  17. Marco ventana = new Marco();
  18. }
  19. }
  20.  
  21. class Marco extends JFrame
  22. {
  23. public Marco()
  24. {
  25. Lamina panel = new Lamina();
  26.  
  27. this.add(panel);
  28. this.setTitle("ventana");
  29. this.setSize(500, 500);
  30. this.setVisible(true);
  31. this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  32. }
  33. }
  34.  
  35. class Lamina extends JPanel
  36. {
  37. private JButton amarillo;
  38. private JButton azul;
  39. private JButton rojo;
  40.  
  41. public Lamina()
  42. {
  43. AccionColor accionAmarillo = new AccionColor("Amarillo",(new ImageIcon("src/amarillo.gif")),Color.YELLOW);
  44. AccionColor accionAzul = new AccionColor("Azul",(new ImageIcon("src/azul.gif")),Color.BLUE);
  45. AccionColor accionRojo = new AccionColor("Rojo",(new ImageIcon("src/rojo.gif")),Color.RED);
  46.  
  47. amarillo = new JButton(accionAmarillo);
  48. azul = new JButton(accionAzul);
  49. rojo = new JButton(accionRojo);
  50.  
  51.  
  52. this.add(amarillo);
  53. this.add(rojo);
  54. this.add(azul);
  55.  
  56. }
  57.  
  58.  
  59.  
  60. class AccionColor implements Action
  61. {
  62. public AccionColor(String nombre,Icon icono,Color c)
  63. {
  64. this.putValue(Action.NAME, nombre);
  65. this.putValue(Action.SMALL_ICON, icono);
  66. this.putValue("color_de_fondo", c);
  67. this.putValue(Action.SHORT_DESCRIPTION, "poner fondo en " + nombre);
  68. }
  69.  
  70. @Override
  71. public void actionPerformed(ActionEvent arg0) {
  72. // TODO Auto-generated method stub
  73.  
  74. }
  75.  
  76. @Override
  77. public void addPropertyChangeListener(PropertyChangeListener arg0) {
  78. // TODO Auto-generated method stub
  79.  
  80. }
  81.  
  82. @Override
  83. public Object getValue(String arg0) {
  84. // TODO Auto-generated method stub
  85. return null;
  86. }
  87.  
  88. @Override
  89. public boolean isEnabled() {
  90. // TODO Auto-generated method stub
  91. return false;
  92. }
  93.  
  94. @Override
  95. public void putValue(String arg0, Object arg1) {
  96. // TODO Auto-generated method stub
  97.  
  98. }
  99.  
  100. @Override
  101. public void removePropertyChangeListener(PropertyChangeListener arg0) {
  102. // TODO Auto-generated method stub
  103.  
  104. }
  105.  
  106. @Override
  107. public void setEnabled(boolean arg0) {
  108. // TODO Auto-generated method stub
  109.  
  110. }
  111. }
  112.  
  113. }
  114.  
  115.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
ayuda con problema de java
Java
rafa_negro 1 3,362 Último mensaje 29 Enero 2010, 16:20 pm
por Leyer
Ayuda: Problema enlazando varios archivos Fuentes y cabeceras « 1 2 »
Programación C/C++
x64core 14 7,600 Último mensaje 15 Marzo 2012, 21:59 pm
por Eternal Idol
JAVA como declarar multiples objetos a la vez
Java
r7pyrred 2 2,479 Último mensaje 19 Febrero 2013, 01:41 am
por r7pyrred
[AYUDA][Problema] Cargar imagenes en Java (soy nuevo en Java)
Java
Noxware 3 3,774 Último mensaje 14 Septiembre 2014, 19:39 pm
por Noxware
Multiples archivos con XSLT & Saxon en Java
Java
Lind L. Tailor 1 1,831 Último mensaje 24 Marzo 2015, 17:41 pm
por Lind L. Tailor
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines