Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/09/2006, 05:19
Nendrel
 
Fecha de Ingreso: agosto-2006
Mensajes: 35
Antigüedad: 17 años, 9 meses
Puntos: 0
Aquí posteo el código de la ventana:
Código:
/*
 * Puntuacion.java
 *
 * Created on 3 de septiembre de 2006, 1:59
 */

/**
 *
 * @author  Raúl Ramos
 */
import java.util.Observer;
import java.util.Observable;
import java.awt.*;

public class Puntuacion extends javax.swing.JFrame implements Observer{
    
    Graphics g;
    String cadena;
    
    /** Creates new form Puntuacion */
    public Puntuacion() {
        initComponents();
    }
    
    public void paint(Graphics g){

    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Puntuaci\u00f3n");
        getAccessibleContext().setAccessibleName("");
        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 30));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Puntos:");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 140, 30));

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 20));
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("0");
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 50, 100, 40));

        pack();
    }
    // </editor-fold>
    
    public void update(Observable obs, Object obj){
        OData o = (OData)obs;
        jLabel2.setText(String.valueOf(o.getPuntuacion()));
        this.setVisible(true);
    }
    
    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration
    
}