GUI Development
Objective #1: Download the Jigloo software.
- Jigloo, as of now, appears to be the best IDE to create a GUI in Java.
- There are two different ways to download Jigloo. The way I found easier with the hassle of the network limitations is downloading the zip file and extracting the plug-in folder into Eclipse’s plug-in folder. Download this jar file and save it into your “My Documents” folder Jigloo.xml and extract all. Then find the com.cloudgarden.jigloo_4.6.4 folder and move it to the plug-in folder of Eclipse. Restart Eclipse if you have it running; if not, open Eclipse and Jigloo should be installed. If you are using a computer in Mr. Minich’s classroom, you can access the jigloo.xml file from his handout folder.
- The other way is through a direct download into Eclipse. This is the easiest way to download plug-ins into Eclipse when you don’t have the hassle of network limitations. Open Eclipse and go to Help/Install New Software... in this window click on “Add” and type Jigloo for the name and set http://cloudgarden1.com/update-site as the website. Click “Ok.” In the next window, the Jigloo package should be there with a check box next to it, check off the box and click “Next.” (Usually this is the longest part, it can take up to an hour.) After it downloads the available packages, Accept all and proceed to download. Similarly with the jar file, Jigloo should now be installed.
Objective #2: What is Jigloo?
- Now that we have downloaded Jigloo, what is Jigloo? How can Jigloo help me with Java Programming? How will it help me achieve a 5 on the AP exam? First of all, Jigloo is an open source GUI plug-in for Eclipse to allow for graphical programming applications in the Java language. Jigloo creates Swing-based applications and uses the Swing Widget Toolkit (SWT). Jigloo is analogous to Visual Basic except the programming is less forgiving, the programming is more advanced, and the programming is in the Java language. Next, Jigloo will help you, the programmer, with Java programming through observing how to develop a form and how to associate your methods with buttons and other actions. Likewise, this is the only AP Java Progamming class using Jigloo, this will give you a bump up on all other AP Java programmers out there!
- There are two reasons why Jigloo is named the way it is. The first is: a jig holds things together and “glue” keeps it together. The second is: Java programs usually start with a “J” and an igloo is an interesting building.
- Although not the most popular IDE, Jigloo is the easiest and most “programmer” friendly IDE that we can use to learn how to program with an IDE creating GUI’s.
- Swing is the main widget toolkit for GUI design in java and allows for custom widgets to be created.
- GUI programming is creating a graphical user interface to allow for the user to interact with objects instead of text in a program. There are other GUI Plug-ins for Eclipse and Java such as: Netbeans, JBuilder, Jigloo, and Visual Editor.
- We will use Jigloo to program applications that you can then associate with for Android programming.
Objective #3: Start a Jigloo application.
- To begin programming a Jigloo application, you start off just as you would any other program. Go to File/New/Java Project, type in a project name and for the JRE you want to change the execution environment to JavaSE-1.6, this will allow Jigloo to function properly.
- Now create a jFrame. Right click on your project and go to New/Other…/GUI Forms/Swing/jFrame. For Package, put “com.yourname” with no spaces. For Class Name, put the same title as your project name for the time being. Now you have created your first Jigloo project.
- See the HelloWorld demo.
- This is a demo that Cloudgarden supplies online http://www.cloudgarden.com/jigloo/
Objective #4: Understand the main objects of Jigloo.
- Jigloo utilizes Swing. When combined with Jigloo, a drag-and-drop programming interface is created. As the programmer places an object on the jFrame, the instantiation of the variable is preprogrammed and Jigloo import’s all of the packages that are necessary for the object to function without error.
- The objects of Jigloo are categorized into groups such as: Containers, Components, Layouts, Menu, and Custom.
- Containers are the forms that are used to put objects onto. These are the main screen of the application and there are many different types.
- Components are the buttons, labels, and other objects that directly interact with the user. Labels can be used to show what a variable is storing. All of these have properties that can be modified for text, color, or size.
- Layouts need to be put inside of a container for objects to be placed onto the form. One of the programmer friendly layouts is the Absolute Layout.
- Menu items are for extra options in a form. Like with any webpage or application, there is a menu bar at the top and these items are in the Menu category.
- Custom items are all of the objects or items that you, the programmer, create.
- Just like in Visual Basic, you can alter the properties of an object from the Properties window and the code will be adjusted automatically.
- When you place an object on the form, you can set up the formatting of the form or the object by using the vertically positioned Formatting Toolbox. Likewise, there is an Events Tab in the Properties Window that allows the programmer to choose from a list of actions that the user would perform with that object and program specifically to its purpose.
- See the Jigloo screen capture.
Objective #5: Download an alternate IDE, Visual Editor.
- Download Eclipse Ganymede IDE for Java Developers - http://www.eclipse.org/downloads/packages/release/ganymede/sr2
- Extract Eclipse to your flash drive and create a new workspace and run
- Once Eclipse opens go to Help -> Software Updates -> Available Updates and choose all of the Eclipse downloads
- Go to http://www.ehecht.com/eclipse_ve/ve.html and download the appropriate .zip file and extract it into the drop-in folder of eclipse.
- Restart Eclipse.
- Create a new project with a new class just as you would with any other project. Right click on the class and choose Open With and choose Visual Editor, if it freezes just restart Eclipse and start over. This is a result of the network at school and the glitchiness of Visual Editor.
- The Visual Editor Toolbar is the last one from the top; here you can choose to add any type of preprogrammed object. You click and drag the object to the form and then drag it to give it a size. The code is then added to your project.
Objective #6: Understand what Netbeans is.
- Netbeans is an open source Java IDE that allows the programmer to create GUI projects.
- IDE stands for an integrated development environment. An IDE contains a source code editor, a compiler, build tools, and a debugger.
- Netbeans began as Xelfi in 1996 which was a student project in Prague. Then in 1997, Roman Staněk developed a company around Xelfi, spawning the Netbeans we use today. In 1999, Netbeans was purchased by Sun Microsystems, the same company that designed Java.
- Netbeans is capable of running on any computer with a JVM. A JDK is required for programming Netbeans in Java but is not necessary for other programming languages.
- Since 2004, there have been 16 new IDE’s.
- Netbeans is compatible with Java, JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala, Clojure, and other languages.
Objective #7: Using the Netbeans platform.
- Netbeans features modularity with all of the functions for the IDE. Modularity is simply the modules within Netbeans, they are JAR files that contain Java classes. A Module is a library. Programmers (just like you!) can sell modules that they create to other programmers. Some examples of modules are supporting the Java language and editing the language and code. Modules allow for Netbeans to be extended and allow for Netbeans to be updated.
- The Netbeans Profiler allows developers to optimize their program by monitoring their program and search for overloading and memory errors. The profiler was created by Sun and was originally called JFluid and is an add-on module.
- Another module is the Java GUI design tool, FKA project Matisse
- Some files you can gain through web downloads, these files come as a NBN file. Unlike JAR files, NBN files are compressed, contain multiple JAR files, contain metadata, and are usually signed.
- Clusters are groups of modules in a directory on a disk. Usually, small programs don’t need clusters, but they do use clusters when Netbeans is started.
Objective #8: Use JForm Designer to create GUI interfaces.
- JForm Designer is a GUI designer using Java Swing. This can be a plug-in for Eclipse or a stand-alone program.
- JForm is very similar to Netbeans but is easier to use on the network.
- To download JForm Designer: Go to JForm Download and choose from either the stand-alone or the plug-in. These instructions will guide you through the stand-alone version. Choose Windows Set-up with JRE 6 under the Stand-Alone category. Run the download instead of Saving the download files. Running allows for a faster download and less memory to be used by saving the download files. Save the program into your “My Document” folder and click Run after the download. JForm then begins and you will have to register your version. Go to JForm Evaluation and request a trial registration code. This will then allow you to use this registration code for 20 days. You must put a real email address because this is where the email you the trial code, but you can put a fake name. After the 20 day trial, you can re-request an evaluation code.
- It appears that Jigloo uses the same design features of JForm Designer.
- JForm allows the programmer to export the “hard” code to a file that can then be used to transfer to Java and program from there.