Java: Difference between revisions
Jump to navigation
Jump to search
(→Swing) |
|||
Line 24: | Line 24: | ||
= Swing = | = Swing = | ||
* http://zetcode.com/tutorials/javaswingtutorial/ | * http://zetcode.com/tutorials/javaswingtutorial/ | ||
* http://docs.oracle.com/javase/tutorial/uiswing/start/compile.html | |||
For example, | For example, create a new subdirectory 'start' and put HelloWorldSwing.java there. Then we can build and run the swing program by | ||
<pre> | <pre> | ||
javac start/HelloWorldSwing.java # Or javac HelloWorldSwing.java if we are in start directory | |||
java start.HelloWorldSwing | |||
</pre> | </pre> |
Revision as of 10:43, 3 March 2014
Install openjdk
See http://openjdk.java.net/install/. On Ubuntu, I can use
sudo apt-get install openjdk-7-jdk
Some projects written in Java
- FastQC The code uses Java 2D graphics APIs in awt like BasicStroke, Color, Dimension, Graphics, Graphics2D, RenderingHints and javax.swing.JPanel. It also uses java.util.Vector.
Tutorial
Compile a simple Java program
javac Example.java # generate Example.class; bytecode version of the program java Example # run bytecode in Java Virtual Machine
Get a hello world program from http://docs.oracle.com/javase/tutorial/getStarted/cupojava/unix.html.
Swing
- http://zetcode.com/tutorials/javaswingtutorial/
- http://docs.oracle.com/javase/tutorial/uiswing/start/compile.html
For example, create a new subdirectory 'start' and put HelloWorldSwing.java there. Then we can build and run the swing program by
javac start/HelloWorldSwing.java # Or javac HelloWorldSwing.java if we are in start directory java start.HelloWorldSwing