Title | Cómo crear un ejecutable en Java con Eclipse |
---|---|
Course | Informática Aplicada Para Ingeniería 3 2 5 4 o 5 |
Institution | Universidad Nacional del Callao |
Pages | 5 |
File Size | 376.9 KB |
File Type | |
Total Downloads | 69 |
Total Views | 138 |
course...
¿Cómo crear un ejecutable en Java con Ecplipse? Año 2019
Cree el Proyecto PrimaTaxi -
Seleccione File / New / Java Project Project name: PrimaTaxi [ Finish ]
Añada un JFrame al Proyecto -
Ilumine src y haga clic derecho Seleccione New / Other En WindowBuilder / SwingDesigner seleccione JFrame Package: gui Name: PrimaTaxi
Copie las imágenes proporcionadas en la carpeta PrimaTaxi
Remplace el código fuente generado por este otro package gui; import java.awt.EventQueue; import import import import import
javax.swing.JFrame; javax.swing.JPanel; javax.swing.border.EmptyBorder; javax.swing.JLabel; javax.swing.ImageIcon;
public class PrimaTaxi extends JFrame { private static final long serialVersionUID = 1L; private JPanel contentPane; private JLabel lblFondo; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { PrimaTaxi frame = new PrimaTaxi(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public PrimaTaxi() { final int ANCHO = 786, ALTO = 425, DX = 6, DY = 29; setResizable(false); setTitle("PrimaTaxi SAC \u00AE"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(0, 0, ANCHO + DX, ALTO + DY); this.setIconImage(new ImageIcon("PT.png").getImage()); this.setLocationRelativeTo(null); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); // Estas tres instrucciones deben ser siempre las últimas lblFondo = new JLabel(new ImageIcon("PrimaTaxi.png")); lblFondo.setBounds(0, 0, ANCHO, ALTO); contentPane.add(lblFondo); } }
Grabe todo y ejecute el proyecto clic clic
Cree el ejecutable
clic derecho
-
Seleccione Export… / Java / JAR file [ Next > ]
-
Pulse [ Browse… ] y abra la carpeta PrimaTaxi
-
Nombre: PrimaTaxi
-
Pulse [ Guardar ]
-
Pulse [ Browse… ] y clic izquierdo en
-
Pulse [ OK ]
[ Next > ]
[ Finish ]
[ Next > ]
-
Abra desde Windows la carpeta PrimaTaxi y seleccione el ejecutable
clic derecho
-
Cree un acceso directo al ejecutable
-
Lleve el acceso directo al Escritorio. Haga clic derecho: Propiedades / Cambiar ícono… / Examinar…
-
Ubique en la carpeta PrimaTaxi el archivo PT.ico
“El talento es bendición Divina. Una gota de sabiduría puesta en el Ser.”
MP...