Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 3 of 6
File offers the following menu items:
Edit offers the following menu items:
Additionally:
The JPad application also lets users specify a file to be opened as a command-line argument. If a user drops a file being dragged onto its text area, JPad will open that file after letting the user save any recent changes.
Oracle's JavaFX website extensively documents the JavaFX architecture. That is also where you'll find JavaFX development software for your 32-bit or 64-bit Windows or Mac OS X platform. I used the JDK 7u2 with JavaFX SDK integrated software package (which includes the JavaFX 2.0.2 SDK) on a Windows XP platform to develop my JavaFX 2 JPad application.
In order to explore JPad in your development environment, download its source code and resource file: JPad.java and icon.png. After extracting these files to your current directory, execute the following commands to compile JPad.java and run it. Note that the third command tells JPad to open and display the contents of JPad.java:
javac JPad.java
java JPad
java JPad JPad.java
JPad is implemented as a single JPad top-level class. As with many Swing applications, JPad extends the javax.swing.JFrame class, which makes it a kind of frame window. You can see this in Listing 1.
// ...
public class JPad extends JFrame
{
// ...
public JPad(String[] args)
{
// ...
if (args.length != 0)
doOpen(new File(args[0]));
}
private void doExit()
{
// ...
}
private void doNew()
{
// ...
}
private void doOpen()
{
doOpen(null);
}
private void doOpen(File file)
{
// ...
}
private boolean doSave()
{
// ...
}
private boolean doSaveAs()
{
// ...
}
private String read(File f) throws IOException
{
// ...
}
private void write(File f, String text) throws IOException
{
// ...
}
public static void main(final String[] args)
{
Runnable r = new Runnable()
{
@Override
public void run()
{
new JPad(args);
}
};
EventQueue.invokeLater(r);
}
}
Listing 1 shows you JPad's skeletal framework, which consists of a constructor, several private methods, and the main() entry-point method. (I've commented out everything else because it isn't relevant at this point.)
More from JavaWorld