Cov txheej txheem:

Java Application Ran on a Google Drive Database: 8 Kauj Ruam
Java Application Ran on a Google Drive Database: 8 Kauj Ruam

Video: Java Application Ran on a Google Drive Database: 8 Kauj Ruam

Video: Java Application Ran on a Google Drive Database: 8 Kauj Ruam
Video: Sample: Upload File To GoogleDrive By Java 2024, Kaum ib hlis
Anonim
Java Application Ran on a Google Drive Database
Java Application Ran on a Google Drive Database
Java Application Ran on a Google Drive Database
Java Application Ran on a Google Drive Database
Java Application Ran on a Google Drive Database
Java Application Ran on a Google Drive Database

Koj puas tau xav tsim daim ntawv thov uas ua haujlwm ntawm cov ntaub ntawv muaj zog uas yooj yim rau kev ua haujlwm nrog, tso cai rau cov neeg siv tsis siv thev naus laus zis los nkag cov ntaub ntawv rau hauv, thiab tsis ua haujlwm hauv tuam txhab cov peev txheej? Zoo, tom qab ntawd kuv muaj kev daws teeb meem rau koj. Hnub no, peb yuav tsim ib daim ntawv thov uas khiav hauv Google Drive (zoo, tshwj xeeb hauv Google Ntawv) thiab tuaj yeem siv rau ntau lub hom phiaj sib txawv. Txawm hais tias qhov kev qhia no yuav tsom mus rau tsim ib qho app-based app los qhia cov npe ntawm cov xwm txheej tshwm sim nyob ib puag ncig hauv tsev kawm qib siab, txoj haujlwm no tuaj yeem rov sau tau yooj yim los ua haujlwm ntau txoj hauv kev, puas yog lub laij lej app rau app uas saib xyuas stocks rau cov khoom. Kuv tau txuas daim ntawv theej ntawm kuv daim ntawv thov yog tias koj xav pom seb peb yuav ua dab tsi. Unzip zip cov ntaub ntawv thiab khiav JAR sab hauv nws. Thiab tam sim no, yam tsis muaj ado ntxiv, cia pib!

Kauj ruam 1: Yam Koj Yuav Tsum Tau

Txhawm rau pib nrog txoj haujlwm no, koj yuav xav tau cov peev txheej hauv qab no:

  • Netbeans

    Kuv pom zoo Java EE rub tawm raws li nws muab kev txhawb nqa rau server, tab sis yog tias koj tsis xav tau qee cov ntaub ntawv tsis tsim nyog lossis qhov chaw ntxiv disk, Java SE yuav ua haujlwm ib yam nkaus. Netbeans yuav ua haujlwm tawm IDE rau kev sau thiab sau peb daim ntawv thov

  • Jsoup

    Kuv tau suav qhov no hauv Cov Lus Qhia rau koj rub tawm. Nws yog HTML parser uas yuav tso cai rau peb rub cov ntaub ntawv los ntawm daim ntawv nthuav tawm

  • Java SDK (V8)

    Rub tawm cov ntawv twg los haum koj lub cev. Yog tias koj twb muaj Java SDK hauv ib qho dhau los, kuv pom zoo hloov kho. Qee qhov kuv ua haujlwm siv cov kab lus tshiab lambda ib txwm muaj rau v8, thiab cov cai yuav tsis ua haujlwm yam tsis muaj lawv nyob ntawm qhov koj ua

  • Visual Studio (Tsis teb los tau)

    Tsis teb los tau. Txawm hais tias NetBeans ua haujlwm zoo kawg rau kev suav sau thiab ntim peb lub app, Kuv tsis yog tus kiv cua loj ntawm kev txhim kho studio. Kuv nyiam ua tus lej hauv VS, vim nws muaj lub ntsej muag zoo dua. Yog tias koj tsis nyiam qhov no, muaj ntau ntau lwm IDEs online, yog li nrhiav yam koj nyiam tshaj plaws

  • Starter Code

    Kuv tau suav nrog tus lej pib hauv cov peev txheej ntawm no, thiab tseem luam tawm nws rau GitHub. Hauv qhov no, Kuv muaj cov ntaub ntawv tseem ceeb (Txheej Txheem) uas muab cov qauv rau cov ntawv uas tau ua tiav lub app, nrog rau EventTester, uas siv JavaFX los tsim GUI rau lub app. Yog tias koj xav tau txais kev paub dhau los, kuv tsis hais kom luam thiab muab tshuaj txhuam. Siv koj lub sijhawm thiab nyeem los ntawm qhov no

Lwm tus:

Kev paub pib ntawm Java. Nws yuav pab tau kom paub zoo hauv Java, xws li sau cov haujlwm, tsim khoom, thiab lwm yam

Kauj ruam 2: Teem Koj Li Database

Teem Koj Li Database
Teem Koj Li Database

Txhawm rau pib txoj haujlwm, thawj zaug peb yuav tsum nkag mus rau hauv Google Drive thiab tsim daim ntawv uas peb yuav siv los khiav peb daim ntawv thov. Lub taub hau dhau mus rau drive.google.com thiab nyem rau lub cim "Tshiab" nyob rau sab saum toj sab laug, thiab xaiv "Ntawv" hauv qab no.

Thaum koj daim ntawv tau thauj khoom, mus tom ntej thiab hloov lub npe no mus rau qee yam uas pom tau yooj yim. Tom qab ua li ntawd, mus tom ntej thiab sau rau kab saum toj kawg nkaus nrog koj cov ntaub ntawv npe, xws li yam uas koj yuav muab tso rau hauv txhua kab ntawv. Saib ntawm kuv tus piv txwv ntawm no, Kuv tau sau cov kab saum toj kawg nkaus nrog yam xws li "Lub Npe Lub Npe," "Hnub Tim," thiab lwm yam.

Tom qab ua li ntawd, pib sau koj cov ntawv nthuav qhia nrog cov ntaub ntawv koj xav sau. Nco ntsoov ua txhua yam ntawm koj cov ntaub ntawv zoo sib xws, yog li cov cai tuaj yeem ua haujlwm nrog nws yam tsis cuam tshuam qhov cuam tshuam. Piv txwv li, yog tias koj npaj yuav siv hnub tim hauv koj cov cai, ua tib zoo ntsuas txhua hnub uas zoo ib yam, txwv tsis pub tus lej yuav tsis tuaj yeem cais nws.

Tom qab muab koj cov ntaub ntawv, tshaj tawm daim ntawv nthuav tawm los ntawm kev mus rau "Cov Ntaub Ntawv" -> "Tshaj tawm rau lub vev xaib." Txij ntawm no, koj yuav xav xaiv tag nrho cov ntawv thiab xyuas kom nws tau luam tawm ua HTML ntaub ntawv, txoj kev ntawd peb li app tuaj yeem kos cov ntaub ntawv kom raug. Tom qab tshaj tawm koj daim ntawv teev npe, nco ntsoov ua kom nco ntsoov ntawm qhov txuas uas nws muab. Qhov no yuav xav tau tom qab hauv app.

Kauj Ruam 3: Teeb NetBeans

Teeb tsa NetBeans
Teeb tsa NetBeans

Tam sim no peb muaj peb daim ntawv nthuav tawm, nws yog lub sijhawm los teeb tsa NetBeans yog li peb tuaj yeem pib coding. Tom qab koj rub tawm thiab teeb tsa NetBeans thiab koj Java SDK, mus tom ntej thiab tsim txoj haujlwm tshiab. Thaum xaiv hom, xaiv pawg "Java", thiab "Java Application" project. Xaiv qhov twg los xij uas koj xav kom koj txoj haujlwm raug hu (Kuv lub npe hu ua "Event"). Xaiv lub npov ntawm ib sab "siv cov ntawv tshwj xeeb rau khaws cov tsev qiv ntawv," ntxiv rau ib qho ntxiv "Tsim cov chav kawm tseem ceeb." Tom qab qhov no, NetBeans yuav tsum tsim cov phiaj xwm thiab cov npe rau peb kom pib ua haujlwm, zoo ib yam li ib daim duab.

Ua ntej peb yuav pib coding, peb tseem yuav tsum tau ua kom ntseeg tau tias NetBeans muaj JSoup lub tsev qiv ntawv nws yuav xav tau los cais peb cov ntawv nthuav tawm. Hauv NetBeans, nyem txoj cai "Libraries" lub cim nyob hauv koj txoj haujlwm phau ntawv teev npe. Hauv qab cov ntawv qhia zaub mov pop-up, xaiv lub pob kom ntxiv.jar cov ntaub ntawv. Tam sim no, txav mus rau txhua qhov chaw koj tso koj li jsoup rub tawm (feem ntau yuav yog koj li ntawv rub tawm, tshwj tsis yog koj tau hais qhia lwm qhov). Xaiv cov ntawv no thiab ntxiv nws lub tsev qiv ntawv. Yog tias koj nthuav koj lub tsev qiv ntawv hauv NetBeans, koj yuav tsum pom tam sim no jsoup.jar hauv cheeb tsam no. Tau ua tiav, tam sim no peb tuaj yeem pib coding peb app.

Kauj Ruam 4: Coding Peb Chav Kawm Tseem Ceeb

Coding Peb Chav Kawm Tseem Ceeb
Coding Peb Chav Kawm Tseem Ceeb

Yog li, thawj qib hauv kev sau peb lub app yog tsim koj chav kawm tseem ceeb. Koj chav kawm tseem ceeb yuav yog qhov uas peb tsim peb cov khoom, muaj cov txheej txheem uas cuam tshuam nrog JSoup, thiab ntau ntxiv. Piv txwv tias txhua tus nyeem qhov no muaj kev paub dhau los, mus tom ntej thiab siv cov khoom lag luam hauv qab no:

ntshuam java.util. Collections;

ntshuam java.util. List;

ntshuam java.util. ArrayList;

ntshuam java.util. Date;

ntshuam java.util.stream. Stream;

ntshuam java.util.stream. Collectors;

ntshuam java.text. SimpleDateFormat;

ntshuam java.text. ParseException;

ntshuam org.jsoup. Jsoup;

ntshuam org.jsoup.nodes. Document;

ntshuam org.jsoup.nodes. Element;

ntshuam org.jsoup.select. Elements;

ntshuam javafx.beans.property. SimpleStringProperty;

Qhov no yuav zoo li ntau, thiab nyob ntawm koj txoj haujlwm, txhua yam yuav tsis tsim nyog. Raws li peb txuas ntxiv cov cai, NetBeans yuav qhia rau koj paub yog tias koj muaj cov khoom siv tsis siv, yog li peb ib txwm tuaj yeem tshem tawm lawv tom qab. Txawm li cas los xij, qhov no yog yam peb xav tau tam sim no.

Tau txais peb cov lus tshaj tawm, cia mus tom ntej thiab tshaj tawm peb chav kawm. Yog tias koj npaj yuav siv Hnub Tim lossis ib yam khoom uas tsis yog yooj yim thaum txhim kho koj cov khoom tshwj xeeb hauv chav kawm, Kuv pom zoo ntxiv qhov "piv piv piv" rau koj cov ntawv tshaj tawm hauv chav kawm. Qhov no yuav tso cai rau koj los sib piv Cov Hom Phiaj, uas yuav tso cai rau koj txheeb cov npe ntawm ClassObjects tom qab. Tom qab ua qhov no, mus tom ntej thiab tshaj tawm txhua qhov piv txwv uas koj xav tau. Rau txhua txoj hlua pej xeem koj tsim, koj kuj yuav tsum tsim SimpleStringProperty rau nws. Cov no yog JavaFX cov khoom uas yuav tso cai rau peb ua haujlwm nrog peb cov khoom tseem ceeb hauv chav kawm tom qab.

Tam sim no, mus tom ntej thiab tshaj tawm koj nkag mus rau lub luag haujlwm. Raws li koj qhov kev hloov pauv yooj yim mus, koj tuaj yeem sau koj lub luag haujlwm yam koj xav tau. Txawm li cas los xij, rau koj SSP kev ua haujlwm, koj yuav tsum siv hom ntawv getFunctionNameHere (). Qhov no yog vim tom qab peb yuav siv JavaFX los txuas rau cov haujlwm no, thiab cov haujlwm peb yuav siv xav kom peb pib peb cov haujlwm SSP nrog tau txais. Koj tuaj yeem pom qhov piv txwv saum toj no.

Tom qab txheeb xyuas txhua qhov ntawm koj li kev hloov pauv, mus tom ntej thiab txhais lwm yam haujlwm uas koj xav tau. Qhov no yog cov neeg siv tshwj xeeb, raws li cov haujlwm koj xav tau nrog sib txawv ntawm qhov project mus rau project. Yog tias koj xav tau qee qhov kev tshoov siab, txheeb xyuas kuv Javadoc lossis tus lej tseeb thiab pom qee qhov haujlwm uas kuv tau ua. Piv txwv li, Kuv tau tsim cov haujlwm ua haujlwm uas txheeb Cov Npe los ntawm Hnub, nrog rau cov haujlwm uas rov qab tsuas yog Cov Txheej Txheem nrog pab pawg ntawm cov pej xeem, thiab ntau ntxiv. Txawm hais tias nws ua tau los ua cov zoo li no koj tuaj yeem ua qee qhov kev sim, Kuv pom zoo kom tsis txhob muaj cov txheej txheem zoo li qub thaum koj ua tiav kev debugging, kom tsis txhob yuam kev thaum peb mus rau kauj ruam tom ntej ntawm txoj haujlwm.

Kauj Ruam 5: Txheeb Peb Tsim () Txoj Kev

Txhais Peb Tsim () Txoj Kev
Txhais Peb Tsim () Txoj Kev

Tam sim no tuaj yeem yog qhov tseem ceeb tshaj plaws ntawm cov cai, qhov uas peb yuav piav qhia peb tsim () txoj hauv kev, uas yog dab tsi uas yuav nkag mus rau peb lub vev xaib thiab tau txais peb cov ntaub ntawv. Nws yog ib qho tseem ceeb kom nco ntsoov tias koj yuav tsum tau ntxiv qhov cuam tshuam kab tshwj xeeb rau koj txoj kev tshaj tawm, yog li peb tsis tas yuav sau sim sim rau hauv peb cov cai. Txhawm rau pib, mus tom ntej thiab tshaj tawm Cov Npe Tsis Txaus ntawm koj lub hom phiaj. Hauv kuv rooj plaub, nws zoo li

Cov xwm txheej txheej xwm = tshiab ArrayList ()).

Tam sim no, mus thiab pom qhov URL koj tau theej ua ntej ua ntej rau daim ntawv nthuav tawm. Tshaj tawm qhov txuas no ua ib txoj hlua hauv Java, thiab hu nws txhua yam koj xav tau. Tam sim no, mus tom ntej thiab tshaj tawm daim ntawv Jsoup tshiab. Koj tuaj yeem ua qhov no los ntawm kev tsim cov ntaub ntawv tshiab yam khoom, xws li

Cov ntaub ntawv doc = Cov Ntaub Ntawv tshiab ();

Tam sim no, mus tom ntej thiab teeb tsa koj cov ntawv txhawm rau txuas rau peb qhov URL thiab tau txais cov ntaub ntawv. Ua li ntawd, sim:

Cov ntaub ntawv doc = Jsoup.connect (url).get ();

Tam sim no, peb yuav tsum tau txais lub cev ntawm peb cov ntaub ntawv, uas yog qhov twg cov ntaub ntawv raug khaws cia.

Txoj hlua lub cev = doc.body (). Ntawv ();

Tam sim no, peb yuav tsum pib rub cov ntaub ntawv tawm ntawm lub cev. Txij li peb cov ntaub ntawv nyob hauv lub rooj (txij li nws yog daim ntawv nthuav qhia), peb yuav tsum rub lub rooj tawm ntawm lub cev. Cia peb sim

Element table = doc.select ("table"). Tau (0);

Qhov no xaiv Thawj lub rooj. Hauv qhov no, tsuas muaj ib qho xwb. Tam sim no, hom

Elements row = table.select ("tr");

Qhov no tau txais peb txhua kab hauv cov lus ntawd.

Yog li, tam sim no, tag nrho peb cov ntaub ntawv nyob hauv kab no sib txawv. Qhov ntawd zoo thiab txhua yam, tab sis tag nrho cov ntsiab lus hauv kev sau cov haujlwm no hauv chav kawm no yog li peb tuaj yeem tsim cov khoom tawm ntawm nws. Yog li, ua ntej peb tuaj yeem xa rov qab qhov no, peb yuav tsum tsim Daim Ntawv Teev Npe los ntawm peb kab. Txhawm rau ua qhov no, peb tuaj yeem siv lub voj. Kuv yuav tsum nco ntsoov tias qhov no coj kuv mus sim me ntsis thiab yuam kev kom raug. Kuv pom tau tias thaum rub los ntawm kab, qee qhov ntawm peb cov ntaub ntawv tsis muaj txiaj ntsig rau qhov xwm txheej no, vim nws muab cov khoom zoo li tus kheej daim ntawv lub npe, thawj kab nrog peb cov tswv yim cov ntaub ntawv ntawm nws, thiab lwm yam Thaum kawg, Kuv teeb tsa thawj zaug nkag tus lej rau lub voj rau 2, yog li nws hla cov khoom no thiab tuaj yeem tsim peb cov khoom. Thaum kawg, kuv tsim kev saib nrog cov cai

rau (int kuv = 2; kuv <rows.size (); kuv ++) {

Element row = rows.get (kuv);

Cov ntsiab lus cols = row.select ("td");

Tam sim no, los tsim ib qho khoom, ua tej yam zoo li

Lub hom phiaj lub npe = Lub Hom Phiaj tshiab (cols.get (0).text ());

Qhov tseem ceeb, cov cols.get (0) yuav tau txais cov ntaub ntawv los ntawm kab (i) kem (0), thiab tig nws mus rau hauv Txoj hlua uas tom qab ntawd tuaj yeem dhau mus rau hauv cov khoom tsim.

Tom qab teeb tsa koj txoj kev tsim kho, ntxiv nws rau Daim Ntawv Peb tsim ua ntej nrog list.add (), xws li

events.add (npe);

Tam sim no, kaw koj lub voj, thiab hu rau cov haujlwm uas koj xav tau tam sim no. Piv txwv li, Kuv tau hu kuv qhov kev ua haujlwm kom tau txais Cov Txheej Txheem raws li hnub tim. Tom qab ua li ntawd, xa koj Daim Ntawv Teev Npe thiab tom qab ntawd koj ua tiav nrog ntu no!

Kauj Ruam 6: Coding Peb Daim Ntawv Thov

Coding Peb Daim Ntawv Thov
Coding Peb Daim Ntawv Thov
Coding Peb Daim Ntawv Thov
Coding Peb Daim Ntawv Thov

Tsim cov ntaub ntawv tshiab thiab npe nws xijpeem koj xaiv. Koj yuav xav tau cov khoom lag luam hauv qab no:

ntshuam java.util. List;

ntshuam java.util. ArrayList;

ntshuam java.util. Date;

ntshuam javafx.geometry. Pos;

ntshuam javafx.scene.layout. HBox;

ntshuam javafx.application. Application;

ntshuam javafx.collections.transformation. FilteredList;

ntshuam javafx.scene.text. Font; ntshuam javafx.scene.control.*;

ntshuam javafx.collections. FXCollections;

ntshuam javafx.collections. ObservableList;

ntshuam javafx.geometry. Insets;

ntshuam javafx.scene. Group;

ntshuam javafx.scene. Scene;

ntshuam javafx.scene.control. Label;

ntshuam javafx.scene.control.cell. PropertyValueFactory;

ntshuam javafx.scene.layout. VBox;

ntshuam javafx.stage. Stage;

Kuv paub qhov no yuav zoo li ntau, tab sis ntseeg kuv, lawv tsim nyog rau peb los tsim tsim peb daim ntawv thov. Mus tom ntej thiab tshaj tawm koj chav kawm, thiab paub tseeb tias nws txuas ntxiv Daim Ntawv Thov, vim qhov no yog ib feem tsim nyog ntawm txoj haujlwm. Thaum pib, tshaj tawm qhov hloov pauv tshiab piv txwv uas yog TableView ntawm koj lub hom phiaj, xws li

ntiag tug TableView rooj = tshiab TableView ();

Tsis tas li, tshaj tawm txoj hauv kev tseem ceeb, uas peb yuav siv los tso lub app. Qhov tseem ceeb, nws yuav tsum zoo li daim duab nyob saum toj.

Tam sim no, peb yuav tsum tsim peb txoj kev pib. Nco ntsoov tias nws cuam tshuam rau kev zam, txij li peb yuav tau hu rau tsim () txheej txheem los ntawm peb cov chav kawm qub. Ua qhov xwm txheej tshiab uas tsis muaj qhov ntsuas, yooj yim yog li peb tuaj yeem hu tus txheej txheem tsim nrog nws. Txhais cov npe tshiab, thiab teeb nws sib npaug rau qhov tshwm sim ntawm tsim (). Tam sim no, tsim qhov ObservableList tshiab, uas yuav siv los sau peb lub rooj nrog peb cov ntaub ntawv. Txhais nws zoo li:

ObservableList cov ntaub ntawv = FXCollections.observableArrayList ();

Tam sim no, tsim qhov xwm txheej tshiab nrog:

Scene scene = Scene tshiab (Pawg tshiab ());

Teeb lub npe, qhov dav, qhov siab, thiab lwm yam uas koj xav tau rau txhua yam haujlwm rau koj. Koj tuaj yeem pom kuv qhov txiaj ntsig hauv daim duab saum toj. Tam sim no, peb tuaj yeem pib teeb tsa peb lub rooj. Rau txhua cov ntaub ntawv koj xav kom pom, tsim TableColumn, zoo li:

TableColumn eventCol = TableColumn tshiab ("Lub Npe Lub Npe"); eventCol.setMinWidth (100); eventCol.setCellValueFactory (tshiab PropertyValueFactory ("sName"));

Qhov "sName" qhov ntsuas yuav tsum tau sau nrog xijpeem lub npe ntawm koj li SSP nkag mus siv tau, yog li nws tuaj yeem tau txais qhov txiaj ntsig koj xav tau rau cov khoom uas tau muab. Ua kom ntau Kab Raws li koj xav tau, tom qab ntawd ntxiv lawv rau hauv lub rooj nrog

FilteredList flEvent = FilteredList tshiab (cov ntaub ntawv, p -> tseeb);

table.setItems (flEvent);

table.getColumns (). addAll (eventCol, statCol, groupCol, datingCol, descCol, locationCol);

Yog tias koj xav ntxiv qhov kev tshawb fawb bar zoo li kuv tau ua, txheeb xyuas cov cai rau cov ntaub ntawv yuav ua li cas thiaj tsim tau qhov kev xaiv box thiab textField, uas yuav tso cai rau koj cov neeg siv lim lub rooj los ntawm qhov tshwj xeeb. Yog tias koj tau xaiv ua li ntawd, koj tseem yuav tsum ua hBox kom muaj cov no, nrog

HBox hBox = HBox tshiab (xaiv lub thawv, textField);

hBox.setAlignment (PosCENTER);

Koj tseem yuav xav tau ntxiv hBox rau hauv.addAll () txoj hauv qab no.

Txwv tsis pub, tsuas yog tsim vBox tshiab los tuav peb cov ntaub ntawv los ntawm kev ua

kawg VBox vbox = tshiab VBox ();

vbox.getChildren (). addAll (daim ntawv lo, rooj);

((Pawg) scene.getRoot ()). GetChildren (). AddAll (vbox);

theem.setScene (scene); theem.show ();

Tam sim no, sau koj cov cai thiab khiav nws, thiab saib nws puas ua haujlwm. Siv NetBeans txhawm rau nrhiav ib qho yuam kev, uas yuav tshwm sim li cov kab liab nyob ntawm sab xis ntawm lub vijtsam. Khaws khiav qhov no kom txog thaum koj tsis muaj qhov yuam kev ntxiv, thiab txoj haujlwm ua haujlwm.

Tom qab ua tiav koj tus lej, Kuv yuav pom zoo tsim Javadoc ntawm koj cov cai kom tib neeg tuaj yeem pom koj tus lej ua dab tsi. Txhawm rau ua li ntawd, hauv qab "Khiav" khawm nyob rau sab saum toj ntawm lub vijtsam, tsuas yog ntaus "Tsim Javadoc." Koj tuaj yeem pom daim ntawv theej ntawm kuv Javadoc los ntawm kev saib sab hauv zip cov ntaub ntawv ntawm thawj nplooj ntawv thiab xaiv cov ntawv index.html.

Kauj Ruam 7: Txheeb thiab ntim Peb Cov Ntaub Ntawv Thawv

Ua Ke thiab Ntim Peb Cov Ntaub Ntawv Jar
Ua Ke thiab Ntim Peb Cov Ntaub Ntawv Jar

Thaum koj muaj debugged txaus thiab ua kom nws ua tiav, thaum kawg koj tuaj yeem suav qhov no rau hauv JAR cov ntaub ntawv, uas tom qab ntawd tuaj yeem tshaj tawm yog li lwm tus tuaj yeem ua haujlwm software no yam tsis xav tau NetBeans lossis Jsoup.

Ua ntej suav koj lub app, nco ntsoov tias txhua yam ua tiav. Yog tias koj xav ntxiv cov ntaub ntawv thiab tsim JavaDoc, mus tom ntej ua li ntawd. Yog tias koj muaj System.out cov lus txib uas luam rau koj lub console, tshem tawm lawv. Qhov tseem ceeb, xyuas kom tseeb tias koj lub app tsis muaj cov lus txib lossis lub luag haujlwm tsis xav tau, thiab nws muaj txhua yam nws xav tau los ntim.

Tom qab ua li ntawd, nyem rau ntawm txoj haujlwm npe hauv NetBeans. Nws yuav tsum qhib cov ntawv qhia zaub mov. Ntaus cov khoom (nyob rau hauv qab ntawm cov ntawv qhia zaub mov), tom qab ntawd nyem "Ntim" ntawm sab laug ntawm cov ntawv qhia zaub mov tshiab. Tam sim no, xyuas kom tseeb tias txhua lub checkboxes tau cim. Koj lub vijtsam yuav tsum zoo li qhov saum toj no.

Tom qab ua qhov no, ib zaug ntxiv txoj nyem rau koj qhov haujlwm hauv NetBeans. Txij ntawm no mus, ntaus "Ntxuav thiab Tsim", thiab NetBeans yuav pib coj koj lub tsev qiv ntawv thiab cov ntaub ntawv thiab suav ua ke rau hauv cov ntaub ntawv JAR ua haujlwm. Yog tias txhua yam mus tau zoo, koj yuav tsum pom cov lus hauv lub console tom qab ob peb lub sijhawm qhia koj tias koj li JAR tau ua tiav kev sau, thiab cov ntawv tam sim no tuaj yeem ua haujlwm. Khiav lub app no thiab xyuas kom txhua yam ua haujlwm. Yog tias tsis yog, debug thiab rov ua cov txheej txheem kom txog thaum ua haujlwm tsis raug.

Kauj ruam 8: Ua tsaug

Nrog koj zoo siab! Yog tias koj ua raws txhua cov lus qhia kom raug thiab cim txhua yam zoo, tom qab ntawd koj yuav tsum muaj koj tus kheej daim ntawv thov ua haujlwm. Qhov txias tshaj yog tam sim no txhua lub sijhawm koj lossis lwm tus neeg uas tau nkag mus rau koj daim ntawv teev npe hloov kho cov ntaub ntawv, koj lub app yuav tuaj yeem hloov pauv thiab ua haujlwm rau cov ntaub ntawv tshiab. Nov yog cov vis dis aus nrawm ntawm qhov kuv ua tawm.

Yog tias koj tab tom nrhiav txoj hauv kev txhawm rau txhim kho thiab tsim kho, Kuv pom zoo txheeb xyuas qee yam ntawm JavaFX cov yam ntxwv zoo dua, zoo li FancyText lossis FancyButton, uas tuaj yeem ntxiv qee qhov kawg siab rau koj daim ntawv thov. Hmoov zoo, thiab tso lus tawm yog tias koj xav tau kev pab lossis pom qhov yuam kev hauv kuv tus lej!

Pom zoo: