Base para crear un instalador desde Java

Paquete

import java.io.IOException;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
/**
* @author leyer
*/
public class Install extends  jwizardcomponent.frame.JWizardFrame {
private static final long serialVersionUID = 1L;

private jwizardcomponent.JWizardPanel panel = null;

public static final int _PANEL_0 = 0;
public static final int _PANEL_1 = 1;

protected javax.swing.ImageIcon imageBackground = new javax.swing.ImageIcon("");
public Install() {
this.panel = new WizardPanelMain(getWizardComponents(),"Principal");
getWizardComponents().addWizardPanel(_PANEL_0, panel);
this.panel = new WizardPanel0(getWizardComponents(),"panel");
getWizardComponents().addWizardPanel(_PANEL_1, panel);
initConfigButtons();
this.setSize(WindowsWIDTH,WindowsHEIGHT);
this.setTitle("Instalador");
jwizardcomponent.Utilities.centerComponentOnScreen(this);
this.setVisible(true);
}
static final int WindowsWIDTH = 800;
static final int WindowsHEIGHT= 400
;
private void initConfigButtons(){
getWizardComponents().getBackButton()  .setText("Atras");
getWizardComponents().getNextButton()  .setText("Siguiente");
getWizardComponents().getCancelButton().setText("Cancelar");
getWizardComponents().getFinishButton().setText("Finalizar");
}
private final class WizardPanelMain extends jwizardcomponent.JWizardPanel {
private static final long serialVersionUID = 1L;
private javax.swing.JPanel panelBackground = new javax.swing.JPanel(){
private static final long serialVersionUID = 1L;
@Override
public void paintComponent(java.awt.Graphics graphics){
this.setOpaque(false);
graphics.drawImage(imageBackground.getImage(),0,0,this.getWidth(),this.getHeight(),null);
super.paintComponent(graphics);
}
};
public WizardPanelMain(jwizardcomponent.JWizardComponents jWizardComponents, String title) {
super(jWizardComponents, title);
this.setLayout(new java.awt.BorderLayout());
this.panelBackground.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
this.add(panelBackground,java.awt.BorderLayout.CENTER);
}}
private final class WizardPanel0 extends jwizardcomponent.JWizardPanel{
private static final long serialVersionUID = 1L;
private javax.swing.JPanel panelBackground = new javax.swing.JPanel(){
private static final long serialVersionUID = 1L;
@Override
public void paintComponent(java.awt.Graphics graphics){
this.setOpaque(false);

</code>

<code> graphics.drawImage(imageBackground.getImage(),0,0,this.getWidth(),this.getHeight(),null);
super.paintComponent(graphics);
}
};
public WizardPanel0(jwizardcomponent.JWizardComponents jWizardComponents,String title) {
super(jWizardComponents,title);
this.setLayout(new java.awt.BorderLayout());
this.add(panelBackground,java.awt.BorderLayout.CENTER);
}}
public static void main(String[] args) throws SecurityException, IOException {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
long start, end;
start = System.currentTimeMillis();
new Install().setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
end = System.currentTimeMillis();
System.out.println("Elapsed time: " + (end - start));
}
Anuncios

4 comentarios to “Base para crear un instalador desde Java”

  1. Wonderful blog! Do you have any recommendations for aspiring
    writers? I’m planning to start my own blog soon but I’m a little
    lost on everything. Would you suggest starting with
    a free platform like WordPress or go for a paid option?

    There are so many choices out there that I’m totally overwhelmed .. Any recommendations? Appreciate it!

  2. No se mucho inglês. wordpress es bastante intuitivo y fácil de usar

  3. hola leyer…. estoy interesado en este tema… podrías actualizar el link de descargar… Gracias!

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

A %d blogueros les gusta esto: