blog de Juan12345

AGREGAR BOTON SALIR Y LIMPIAR!

este formulario corre sin problema pero debo agregarle el boton SALIR" y el boton LIMPIAR" AYUDA SI SABEN EL CODIGO Y DONDE VA UBICADO GRACIAS!

import java.awt.*;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JTextField;
/**
*
* @author EDWIN
*/
public class NewJApplet extends JApplet{
//declaracion de variables
Panel cards;
String botonPanel = "Pulsar Botones";
String textPanel = "Ingresar Datos";
JButton boton1, boton2;
JTextField campoTexto1, campoTexto2;
public void init(){
setLayout(new BorderLayout());
setFont(new Font("Helvetica", Font.PLAIN, 14));
//Crea los botones y TextField
JButton boton1 = new JButton("Boton1");
JButton boton2 = new JButton("Boton2");
JTextField campoTexto1 = new JTextField("Ingrese su Nombre", 20);
JTextField campoTexto2 = new JTextField("Ingrese su Apellido", 20);
//Asignacion de colores a boton y a TextField
boton1.setBackground(Color.red);
boton2.setBackground(Color.red);

Ayuda con ejercicio java

Disculpen no especifique la ayuda que necesitaba, este codigo de Netsbean corre sin problemas sale una ventana donde aparece para seleccionar (Azul, Rojo, Verde) En El resultado debería salir el color elegido y NO SALE NADA (EL TEXTO) ahí algo mal en este cogido para que el resultado no me de, por favor si saben cual es el problema se los agradecería.

Saludos

 

Distribuir contenido