Introduction to Java using NetBeans
Section 2 - GUI
Creating a Project with a GUI
4. Right Click on CapturingData in the Projects List. Choose New > JFrame Form and Name your Form
Building your GUI
Modify your form and make it look a little better
Congratulations. You have now just completed your first program with a GUI. It is now time to make it run
Modify the Capturing Data code as follows:
Modifying the Code
Now that you have a running program with a working GUI, it is time to experiment. Try changing the properties of some of the components. Try adding new components. Play around with the code and see what you can do.
A good place to start is by adding a new button and labeling it Exit. Now add an event to this button that causes the program to close when the button is pressed. Use the following code inside your ActionPerformed method to end the program:
Use the website below to find Java String Methods to complete the programs below.
For all assignments marks will be given for form design and layout
Bonus/ Above and Beyond Marks are in effect for these assignments.
Bonus items must include coding, not just pictures/colours/fancy buttons (these are part of layout and design)
Assignment 2.8 - Birthday Program
A sample layout for the input/output screen is shown below.
Create your own version of this screen using a different background, colour, and/or a different text font style/size. Make it look amazing.
Note: Use a Panel the size of your form to set the Background!
Add an Image
Modify the Program so that when the user enters First Name and Last Name in the "Enter Name" field the program the following output will be displayed
DOE Family Birthdays
ICS4U modify the program to include 3 additional names. Using the Lastname print Birthdays as shown belot
DOE Family Birthdays
SMITH Family Birthdays
John's Birthday is on Jan. 1, 2011
Add a Reset Button
Assignment 2.9 - Monogram
Create a monogram application that prompts the user to enter his or her first, middle, and last names and then displays a monogram with the first and middle initial in lowercase and the last initial in uppercase. (You already have most of this code done)
Error Checking - If the user enters less/more than 3 names an error message should appear
ICS4C - Give the user the option of adding/changing one of the options below
Assignment 2.10 - Replace String
Create a Replace String application that displays the new string in a lable. The new string should take a sentence entered by the user and replace every occurence of a substring with the new string supplied.
Make sure that your program is case insensitive
i.e. Tomato should also be found when they search for tomato
ICS4U modify the program so that the user can modify all instances or only the first instance. Use radio buttons for the choices
Assignment 2.11 - Remove String
Create a Remove Sting application that displays a new string in a label. The new string should take a sentence entered by the user and remove every occurrence of a substring supplied by the user.
Modify the program so that the user can remove all instances or only the first instance. Use radio buttons for the choices.
ICS4U add an insert string option .
Posting your Work
Complete the S2 Rubric and place it in a Rubrics folder on your Google Drive. Make sure I have access to edit this file.
Put a link to your Rubric on your website.
Include you drive folders with link to folder, link to jar file, code.
Creating a Jar File