![Page 1: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/1.jpg)
Build Rich Client Forms with ADF Swing and ADF Business Components Tutorial
09/29/07
Shuang Hao
1. Open JDeveloper and make a database connection:
Then input the username and password that the systems administer assigned to you.
3 select “new database conncetion”
1 Select connections
2 right click database
![Page 2: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/2.jpg)
Your password
Your username
click
Chang to oracle.cis.ksu.edu
Chang to ORACLE
click
![Page 3: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/3.jpg)
1. Click
2. Click
Then the tables in the database can be seen here:
Should be your username
2. Make a new application
![Page 4: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/4.jpg)
1
2.Right click 3. Select it
Make some small changes as followings:
Then Click here
![Page 5: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/5.jpg)
Then click here
Then click here
Select it first
![Page 6: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/6.jpg)
Then click
Right now, a new empty application is created.
![Page 7: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/7.jpg)
1 Right click 2 Select it
In the following window,
Then Select
Select it first
Last, click it
In the next window, just click “OK”.
![Page 8: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/8.jpg)
Then in the new window as following, move “department” and “employee” from “Available” to “Selected” by clicking “>” button. Then click “Next”.
In the next window, click “>>” to select all.
![Page 9: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/9.jpg)
![Page 10: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/10.jpg)
In the next window, change Object Name as EmployeeVO and DepartmentVO, resp.
1. Change name
2. Click
![Page 11: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/11.jpg)
1. Click it
2. Add it
4. Click it
3. Change name
Change name
Then click
![Page 12: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/12.jpg)
Only Click “Next ” in the next window, and then Just click “Finish” in the next step.The working space should look like this:
3. Creating a Master‐Detail ADF Swing Form
1. Right click UserInterFace 2. Select New
In the following window,
![Page 13: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/13.jpg)
2. Select it
1.Select it
Then click “OK” to get to another window.
Change name
Then click
The resulting workspace should look like this:
![Page 14: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/14.jpg)
In the workspace , select Navigation Bar then right click, select cut to delete it.
Then select cut to delete itSelect it,
and then right click
![Page 15: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/15.jpg)
Click here first
Add name
1. Click here
2. Select
![Page 16: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/16.jpg)
The resulting window should look like this:
![Page 17: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/17.jpg)
Select it
1
2 drag it 3
Then select “add Child” Navigation Bar
Add TextFields:
![Page 18: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/18.jpg)
Select it
1
2 drag it to 3
3 4 Select TextField
Repeat the same 1.2.3.4 steps for “shortname” and “name”. And then add labels for each of them as following:
1 Select ADF Swing Controls
3 2 Drag it to 3
Repeat the same steps for another two, the resulting is as following picture, then right click each label, select “create binding”—>“Label for”:
![Page 19: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/19.jpg)
In the DepartmentVO1, select a suitable attribute according to the Textfield that it labels
for.
The resulting window is as:
![Page 20: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/20.jpg)
Add a Scrollbar:
1
2. drop it to 3
3
4. select it
Add a ScrollPane:
![Page 21: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/21.jpg)
![Page 22: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/22.jpg)
1. Drag it to 2
2 3. Select Table
Result should look like this
Then in the Navigator,
![Page 23: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/23.jpg)
6 move them here
5 Select
1.Click it
2. Open it
4. Double click 7
3. Click it
Close MDForm.java first, and then reopen it. It should look like this:
![Page 24: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/24.jpg)
Add a NavigatorBar for the table:
1 2 Drag it to 3
3
4 select it
Click MDForm.java then run it, the coming window should look like this:
Adding a Combo Box to a Detail attribute:
![Page 25: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/25.jpg)
5. Click
4. Change to ComboBox
3 Select it
1 select
2 double click
6. Click
1. Select
2. Click
3. Select
4. Click
![Page 26: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/26.jpg)
Change to Name
Change to Deptno
Click “OK” and then run it. Click “deptno”, we can see a Combo Box as in the following picture.
2. See the combo box
4. Creating an Edit Form
![Page 27: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/27.jpg)
In the Applications Navigator, right‐click the View node and select the “New”. Select “ADF Swing” ”Empty Panel”, and click “OK”.
Change Panel or Frame name to ”EmployeeEdit”:
![Page 28: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/28.jpg)
The working space should look
like:
1 select
2 drag it to 3
3
4. Select it
Without changing anything, just clik “OK”, then this window will show up:
In the Navigator Bar, double click “PanelEmployeeVO2Helper.java”; and then select “design” pattern; third, select the panel and set the layout property to Vertical Flow Layout.
![Page 29: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/29.jpg)
1.
3 2
Select any edit form label column and right click to select the” Column Properties”.
![Page 30: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/30.jpg)
Change to None
Select the navigation bar in the panel and open the Property Inspector. Set “hasFindButton“ False, “hasInsertButton” False and “hasNavigationButton” False.
1. Click on it
2.
3. Set false
![Page 31: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/31.jpg)
Open the “MDForm.java” in the design editor, and drag the “EmployeesEdit.java” from the Applications Navigator into the last row, first column of the “MDForm.java” as shown here:
Change text on the button:
1 open
2 Drag it to 3
4. Select it
3
Change text
![Page 32: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/32.jpg)
Run the MDForm.java, on the running window, click on a record row, and then click “Edit” button.
Click
The EmployeeEdit form with the selected record will show up, we can edit the information in this form.
![Page 33: Build Rich Client Forms with ADF Swing and ADF Business ...people.cis.ksu.edu/~hankley/d764/tut07/Hao_ADF-Swing.pdfBuild Rich Client Forms with ADF Swing and ADF Business Components](https://reader034.vdocuments.net/reader034/viewer/2022051916/6008ac2a166e460b357c5024/html5/thumbnails/33.jpg)