Os dejo este código simple que programe hace mucho, es para crear un pequeño instalador desde java o también para un visor de imágenes ,claro habría que codear bastante para hacer uno completo pero este seria la base. lo coloco por si alquilen le sirve.
PD:1 Esta en
Eclipse y no en Netbeans.
Paqueteimport 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;
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);
}}
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);
graphics.drawImage(imageBackground.getImage(),0,0,this.getWidth(),this.getHeight(),null);
super.paintComponent(graphics);
}
};
public WizardPanel0
(jwizardcomponent.
JWizardComponents jWizardComponents,
String title
) { super(jWizardComponents,title);
}}
try {
e.printStackTrace();
e.printStackTrace();
e.printStackTrace();
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
)); }
Un saludo.