Construcción
private Rectangle inicializarRectangulo() {
GraphicsEnvironment entorno = GraphicsEnvironment.getLocalGraphicsEnvironment();
escritorio = entorno.getMaximumWindowBounds();
return escritorio;
}
/**********ANCHO***********/
public int getAncho()
{
bordes=inicializarRectangulo();
return bordes.width;
}
/**********ALTO**************/
public int getAlto()
{
bordes=inicializarRectangulo();
return bordes.height;
}
Efecto de desplazamiento(Subir y Bajar)
public void run(){
while(arrancar){
if(sube_baja==true)
{
cont++;
if(cont=flota.getHeight()){
valor_actual=flota.getAlto()-cont;
flota.setLocation(flota.getAncho()-flota.getWidth(),valor_actual);
flota.setVisible(true);
}
else
{
arrancar=false;
cont=0;
}
}
else
{
cont++;
valor_final=(flota.getHeight()+flota.getHeight()/2)+cont;
if(valor_final=flota.getAlto()){
flota.setLocation(flota.getAncho()-flota.getWidth(), valor_final);
flota.setVisible(true);
}
else
{
arrancar=false;
cont=0;
flota.dispose();
}
}
flota.repaint();
try {
Thread.sleep(2);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/*fin while*/
}
En la proxima les enseñare el mismo efecto pero mas elaborado.
DESCARGAR
Trading Credit Tecnología de la información Conference Call Attomey Casino Insurance Web Hosting and Domains Los préstamos y donaciones Mesothelioma Law Firm Mortgage Loans Donate Car for Tax Credit Commodities Rehab Colegios en línea Donate Política Online games Cómo hacer dinero en línea Lawyer Gas/Electricity Abogados Transfer Defensa Penal Abogados de la Florida Technology money Vender Anualidad de Pago online Bolsa Degree Hosting gratuito Hosting Leyes y abogados Claim Politics Recetas de Cocina Software Recovery Treatment loans Hoteles Online Making Money Salud Negocios Classes hosting Fashion and Design Cord Blood Sell Annuity Payment
No hay comentarios:
Publicar un comentario