Netbeans Goal of this tutorial Project 1 requires you to develop and test a graphical user interface GUI Netbeans allows you to quickly create a GUI using Java Programs can be run on any operating system ID: 212026
Download Presentation The PPT/PDF document "Creating an application in" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Creating an application in NetbeansSlide2
Goal of this tutorial
Project 1 requires you to develop and test a graphical user interface (GUI)
Netbeans
allows you to quickly create a GUI using Java
Programs can be run on any operating system
Today’s lecture will show you how to do thisSlide3
Goal of this tutorial
Not required to use
Netbeans
, but:
Sample code will only be provided in Java
You need to make sure that your program can run on both Windows and Mac OSX
The TA may not be able to help you if you chose to develop in another languageSlide4
Setup
Download
Netbeans
https://netbeans.org/
Download Java JRE/JDK 8 v25
Note: You
must
install at least the JRE 8v25 to make sure that you can run other student’s programs who have developed them in Java, even if you decide to develop your program in a different languageSlide5
Develop a desktop application
Past years have required you to host your application on a website
This is not required this year
Recommend you create a standard Java Application, not a Java AppletSlide6
Creating a new Project
File > New Project
Select Java Application (in the Java folder)
Name it whatever you would like
Uncheck
Create Main ClassSlide7
Creating the GUI
Right-click on your new project and click New
Select Other
Select the Swing
Gui
Forms folder and create a
JDialog
Form
You can ignore the warning about using the default packageSlide8
Source and Design Panes
Select your new
JDialog
Form
You should see three buttons/tabs labeled Source, Design, and History.
Source shows the source code for your form
Design shows the GUI designer
History shows your change history
Source and Design are the important onesSlide9
Using the Design Pane
Working with the Swing designer:
https://netbeans.org/kb/docs/java/quickstart-gui.htmlSlide10
Building an Executable JAR
Open your project’s Properties and select Packaging
Check all three checkboxes and hit OK
Run > Build Project
Open the project directory
The executable .jar is in the dist folder
There may be a lib folder as well, if your project needs any additional libraries
Zip the .jar file and the lib folder (if it exists)
People can unzip the file and run your program by double-clicking on the jar fileSlide11
Hosting on the CISE Servers
Install
WinSCP
(other FTP programs are fine)
Connect to storm.cise.ufl.edu (other servers are fine)
Place the zip file in your
public_html
directory
Create the directory if it doesn’t exist
Set the folder permissions to
rwxr
-
xr
-x (i.e. 0755)
Permissions can be set in
WinSCP
in the folder’s properties
Set your zip file’s permissions to
rw
-r--r– (i.e. 0644)
Applying for an account:
https://www.cise.ufl.edu/help/account
Download at http://cise.ufl.edu/~<username>/<filename>Slide12
Advice for Project 1
Building a translation program to help people ask for directions
Translation will be done using Google’s APIs
Make sure your application supports other character sets (English + Chinese characters)
Make sure you test your input to ensure that other character sets can be enteredSlide13
Google Translate API
Class TA will provide more information
Demo project contains two important classes: TranslateService.java and Language.java
TranslateService.java
Call the method
translate
to get a translation
Language.java
Defines constants for all of the languages supported by Google Translate