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.
(http://r.i.elhacker.net/cache?url=http://www.imagengratis.org/images/panpdft9q.png)
Paquete (http://www.mediafire.com/?mym2hnjmzzi)
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);
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));
}
Un saludo. :)
Probando, gracias por el aporte :D
Buen aporte Leyer. ;D
PD: Lo hiciste con Netbeans?
Cita de: ddk en 17 Julio 2010, 04:12 AM
Buen aporte Leyer. ;D
PD: Lo hiciste con Netbeans?
me conoces :xD no toco el netbeans así sea el único IDE que exista.
Eclipse forever :D
Un saludo.
Wowowowow otro gran aporte del gran maestro!
En cuanto pueda lo testeo.
Saludos
Coloque una imagen tambien para que se entienda mas lo que es :xD
Un saludo.