Ayuda problema con Multiples Fuentes en Java

Iniciado por Mario Olivera, 28 Noviembre 2015, 12:42 PM

0 Miembros y 1 Visitante están viendo este tema.

Mario Olivera

 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 (java) [Seleccionar]
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeListener;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;


public class principal {

public static void main(String[] args)
{
Marco ventana = new Marco();
}
}

class Marco extends JFrame
{
public Marco()
{
Lamina panel = new Lamina();

this.add(panel);
this.setTitle("ventana");
this.setSize(500, 500);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

class Lamina extends JPanel
{
private JButton amarillo;
private JButton azul;
private JButton rojo;

public Lamina()
{
AccionColor accionAmarillo = new AccionColor("Amarillo",(new ImageIcon("src/amarillo.gif")),Color.YELLOW);
AccionColor accionAzul = new AccionColor("Azul",(new ImageIcon("src/azul.gif")),Color.BLUE);
AccionColor accionRojo = new AccionColor("Rojo",(new ImageIcon("src/rojo.gif")),Color.RED);

amarillo = new JButton(accionAmarillo);
azul = new JButton(accionAzul);
rojo = new JButton(accionRojo);


this.add(amarillo);
this.add(rojo);
this.add(azul);

}



class AccionColor implements Action
{
public AccionColor(String nombre,Icon icono,Color c)
{
this.putValue(Action.NAME, nombre);
this.putValue(Action.SMALL_ICON, icono);
this.putValue("color_de_fondo", c);
this.putValue(Action.SHORT_DESCRIPTION, "poner fondo en " + nombre);
}

@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void addPropertyChangeListener(PropertyChangeListener arg0) {
// TODO Auto-generated method stub

}

@Override
public Object getValue(String arg0) {
// TODO Auto-generated method stub
return null;
}

@Override
public boolean isEnabled() {
// TODO Auto-generated method stub
return false;
}

@Override
public void putValue(String arg0, Object arg1) {
// TODO Auto-generated method stub

}

@Override
public void removePropertyChangeListener(PropertyChangeListener arg0) {
// TODO Auto-generated method stub

}

@Override
public void setEnabled(boolean arg0) {
// TODO Auto-generated method stub

}
}

}