Subido por eltunas0908

Graficos

Anuncio
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class Ventana3 extends JFrame{
public Ventana3(){
this.setSize(500,500); //tamaño
setLocation(100,200); //posicion
setBounds(100,200,500,500);
setLocationRelativeTo(null);//centro
//getContentPane().setBackground(Color.BLUE);//color
setDefaultCloseOperation(EXIT_ON_CLOSE);
iniciarComponentes();
setTitle("Ing");
}
private void iniciarComponentes(){
JPanel panel = new JPanel(); panel.setBackground(Color.green);
this.getContentPane().add(panel);
JLabel etiqueta = new JLabel("Hola");
etiqueta.setText("hola");
etiqueta.setForeground(Color.BLUE);
etiqueta.setFont(new Font("cooper black",0,40));
panel.add(etiqueta);
}
private void colocarBotones(){
JButton boton1 = new JButton("Aceptar");
boton1.setBounds(100,100,100,40);
panel.add(boton1);
}
}
//private void colocarRadioBotones(){
// JRadioButton radioBoton1 = new JRadioButton("Opcion1",true);
//radioBoton1.setBounds(100,100,100,40);
//panel.add(boton1);
Descargar