Hao ADF Swing

Embed Size (px)

Citation preview

  • 8/8/2019 Hao ADF Swing

    1/33

    BuildRichClientFormswithADFSwingandADFBusinessComponents

    Tutorial

    09/29/07ShuangHao

    1.OpenJDeveloperandmakeadatabaseconnection:

    Theninput

    the

    username

    and

    password

    that

    the

    systems

    administer

    assigned

    to

    you.

    3selectnewdatabaseconncetion

    1Selectconnections

    2rightclickdatabase

  • 8/8/2019 Hao ADF Swing

    2/33

    Your asswordYourusername

    click

    Changtooracle.cis.ksu.edu

    ChangtoORACLE

    click

  • 8/8/2019 Hao ADF Swing

    3/33

    1.Click

    2.Click

    Thenthetablesinthedatabasecanbeseenhere:

    Shouldbe ourusername

    2. Makeanewapplication

  • 8/8/2019 Hao ADF Swing

    4/33

    1

    2.Rightclick3.Selectit

    Makesomesmallchangesasfollowings:

    ThenClickhere

  • 8/8/2019 Hao ADF Swing

    5/33

    Thenclickhere

    Thenclickhere

    Selectitfirst

  • 8/8/2019 Hao ADF Swing

    6/33

    Thenclick

    Rightnow,anewemptyapplicationiscreated.

  • 8/8/2019 Hao ADF Swing

    7/33

    1Rightclick2Selectit

    Inthefollowingwindow,

    ThenSelect

    Selectitfirst

    Last,clickit

    Inthenextwindow,justclickOK.

  • 8/8/2019 Hao ADF Swing

    8/33

    Theninthenewwindowasfollowing,movedepartmentandemployeefrom

    AvailabletoSelectedby clicking>button. ThenclickNext.

    Inthenextwindow,click>>toselectall.

  • 8/8/2019 Hao ADF Swing

    9/33

  • 8/8/2019 Hao ADF Swing

    10/33

    Inthenextwindow,changeObjectNameasEmployeeVOandDepartmentVO,

    resp.

    1.Changename

    2.Click

  • 8/8/2019 Hao ADF Swing

    11/33

    1.Clickit

    2. Addit

    4.Clickit3.Changename

    Changename

    Thenclick

  • 8/8/2019 Hao ADF Swing

    12/33

    OnlyClickNextinthenextwindow,andthenJustclickFinishinthenextstep.The

    workingspaceshouldlooklikethis:

    3.CreatingaMasterDetailADFSwingForm

    1.RightclickUserInterFace2.SelectNew

    Inthefollowingwindow,

  • 8/8/2019 Hao ADF Swing

    13/33

    2.Selectit

    1.Selectit

    ThenclickOKtogettoanotherwindow.

    Chan ename

    Thenclick

    Theresultingworkspaceshouldlooklikethis:

  • 8/8/2019 Hao ADF Swing

    14/33

    Inthe

    workspace

    ,select

    Navigation

    Bar

    then

    right

    click,

    select

    cut

    to

    delete

    it.

    ThenselectcuttodeleteitSelectit,

    andthenrightclick

  • 8/8/2019 Hao ADF Swing

    15/33

    Clickherefirst

    Addname

    1.Clickhere

    2.Select

  • 8/8/2019 Hao ADF Swing

    16/33

    Theresultingwindowshouldlooklike

    this:

  • 8/8/2019 Hao ADF Swing

    17/33

    Selectit1

    3

    Then select add ChildNavigation Bar

    AddTextFields:

  • 8/8/2019 Hao ADF Swing

    18/33

    Selectit1

    2dragitto

    34SelectTextField

    Repeatthesame1.2.3.4stepsforshortnameandname. Andthenaddlabelsfor

    eachofthemasfollowing:1SelectADFSwingControls

    32Dragitto3

    Repeatthesamestepsforanothertwo,theresultingisasfollowingpicture,thenright

    clickeachlabel,selectcreatebinding>Labelfor:

  • 8/8/2019 Hao ADF Swing

    19/33

    IntheDepartmentVO1, selectasuitableattributeaccordingtotheTextfieldthatit

    labels

    for.

    Theresultingwindowisas:

  • 8/8/2019 Hao ADF Swing

    20/33

    AddaScrollbar:

    1

    2.dro itto33

    4.selectit

    AddaScrollPane:

  • 8/8/2019 Hao ADF Swing

    21/33

  • 8/8/2019 Hao ADF Swing

    22/33

    1.Dragitto2

    23.SelectTable

    Resultshouldlooklikethis

    ThenintheNavigator,

  • 8/8/2019 Hao ADF Swing

    23/33

    6movethemhere

    5Select

    1.Clickit2.Openit

    4.Doubleclick7

    3.Clickit

    CloseMDForm.javafirst,andthenreopenit.Itshouldlooklikethis:

  • 8/8/2019 Hao ADF Swing

    24/33

    AddaNavigatorBarforthetable:1

    2Dragitto3

    3

    4selectit

    ClickMDForm.javathenrunit,thecomingwindowshouldlooklikethis:

    AddingaComboBoxtoaDetailattribute:

  • 8/8/2019 Hao ADF Swing

    25/33

    5.Click

    4.ChangetoComboBox

    3Selectit

    1select

    2doubleclick

    6.Click

    1.Select

    2.Click

    3.Select

    4.Click

  • 8/8/2019 Hao ADF Swing

    26/33

    ChangetoName

    ChangetoDeptno

    ClickOKandthenrunit.Clickdeptno,wecanseeaComboBoxasinthefollowingpicture.

    2.Seethecombobox

    4.CreatinganEditForm

  • 8/8/2019 Hao ADF Swing

    27/33

    IntheApplicationsNavigator,rightclicktheViewnodeandselecttheNew. Select

    ADFSwingEmptyPanel,andclickOK.

    ChangePanelorFramenametoEmployeeEdit:

  • 8/8/2019 Hao ADF Swing

    28/33

    Theworkingspaceshouldlook

    like:

    1select

    2dragitto33

    4.Selectit

    Withoutchanginganything,justclikOK,thenthiswindowwillshowup:

    IntheNavigatorBar,doubleclickPanelEmployeeVO2Helper.java;andthenselect

    designpattern;third,selectthepanelandsetthelayoutpropertytoVerticalFlow

    Layout.

  • 8/8/2019 Hao ADF Swing

    29/33

    1.

    2SelectanyeditformlabelcolumnandrightclicktoselecttheColumnProperties.

  • 8/8/2019 Hao ADF Swing

    30/33

    ChangetoNone

    SelectthenavigationbarinthepanelandopenthePropertyInspector.Set

    hasFindButtonFalse,hasInsertButton FalseandhasNavigationButtonFalse.

    1.Clickonit

    2.

    3.Setfalse

  • 8/8/2019 Hao ADF Swing

    31/33

    OpentheMDForm.javainthedesigneditor,anddragtheEmployeesEdit.java

    fromtheApplicationsNavigatorintothelastrow,firstcolumnoftheMDForm.java

    asshownhere:

    Changetext

    on

    the

    button:

    1open

    2Dragitto34.Selectit

    3

    Changetext

  • 8/8/2019 Hao ADF Swing

    32/33

    RuntheMDForm.java,ontherunningwindow,clickonarecordrow,andthenclick

    Editbutton.

    Click

    The EmployeeEdit form with the selected record will show up, we can edit the

    information in this form.

  • 8/8/2019 Hao ADF Swing

    33/33