Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/05/2010, 13:24
Avatar de leocente
leocente
 
Fecha de Ingreso: diciembre-2009
Mensajes: 62
Antigüedad: 14 años, 4 meses
Puntos: 4
Respuesta: Color a Ventana de java

chuidiang Genio! Ya soulucione mi problema!!
Bueno si a alguién le sirve el codigo para que muestre una ventanita azul es:

Código Javascript:
Ver original
  1. import javax.swing.*;
  2.  
  3. import java.awt.Color;
  4.  
  5. public class EjemploSwing {
  6.  
  7.     public static final int ancho=500;
  8.     public static final int alto=300;
  9.     public static void main(String[] args) {
  10.        
  11.         JFrame ventana=new JFrame("Ventana De LeO");
  12.         ventana.setSize(ancho,alto);
  13.        
  14.         JLabel etiqueta=new JLabel("Mi primer Ventana!! ");
  15.         ventana.getContentPane().add(etiqueta);
  16.        
  17.         Color c=Color.BLUE;
  18.         ventana.getContentPane().setBackground(c);
  19.        
  20.         ventana.setVisible(true);
  21.  
  22.     }
  23.  
  24. }

Gracias!!!
un abrazo!