Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C:Usersoreyessamplesjavacreate-jar>type HelloWorldSwing.java
- package start;
- import javax.swing.*;
- public class HelloWorldSwing {
- public static void main(String[] args) {
- //Create and set up the window.
- JFrame frame = new JFrame("HelloWorldSwing");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- JLabel label = new JLabel("Hello World");
- frame.add(label);
- //Display the window.
- frame.pack();
- frame.setVisible(true);
- }
- }
- class Dummy {
- // just to have another thing to pack in the jar
- }
- C:Usersoreyessamplesjavacreate-jar>javac -d . HelloWorldSwing.java
- C:Usersoreyessamplesjavacreate-jar>dir start
- Directorio de C:Usersoreyessamplesjavacreate-jarstart
- 29/04/2009 06:56 p.m. <DIR> .
- 29/04/2009 06:56 p.m. <DIR> ..
- 29/04/2009 06:58 p.m. 200 Dummy.class
- 29/04/2009 06:58 p.m. 622 HelloWorldSwing.class
- 2 archivos 822 bytes
- C:Usersoreyessamplesjavacreate-jar>type manifest.mf
- Main-class: start.HelloWorldSwing
- C:Usersoreyessamplesjavacreate-jar>jar -cmf manifest.mf hello.jar start
- java YourClass
- jar -cvf [name of jar file] [name of directory with Java files]
- Main-Class: [fully qualified name of your main class]
- java -jar [name of jar file]
Add Comment
Please, Sign In to add comment