Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/03/2011, 14:01
Avatar de sivadmp
sivadmp
 
Fecha de Ingreso: febrero-2011
Ubicación: La Paz - Bolivia
Mensajes: 293
Antigüedad: 13 años, 2 meses
Puntos: 20
Respuesta: Seleccionar objetos de un JPanel y con un doble click se habra un cuadro d

hola

ya has dibujado los rectangulos, ahora para modificar el tamaño de los rectangulos tienes que utilizar repaint();

por ejemplo,

private int width=100;
private int height=200;


protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.drawRect(10, 10, width, height);
}


public void update(int w, int h){
this.width=w;
this.height=h;

this.repaint();
}


saludos