Arvutiteaduse instituut
  1. Kursused
  2. 2019/20 kevad
  3. Objektorienteeritud programmeerimine (Narva Kolledž) (LTAT.NR.003)
EN
Logi sisse

Objektorienteeritud programmeerimine (Narva Kolledž) 2019/20 kevad

  • Home
  • Materials
  • Grading
  • Java Glossary
  • Cheat sheet (S1-S6)
  • Source Example
  • Links

Task 1. Position of the mouse

Write a program which shows the position (coordinates x and y) of the mouse when the mouse button is pressed. The information must be placed at the same place where the mouse button has been pressed. Once the mouse button is released, the information must disappear.

Example of the output:

Task 2. Flag

Upgrade the flag program of the last home assignment as follows. If the window is resized using the mouse, the flag has to be resized accordingly.

Hints: There is no particular event for resizing the window; therefore, apply the change listener to the stage properties (widthProperty and heightProperty). Create a method for the canvas drawing and call it when the size of the window is changed. Bind the size of the canvas with the size of the window using the method bind() (e.g. myCanvas.widthProperty().bind(myStage.widthProperty());). More info about binding is here.

Task 3. Calculator

Write a program which creates a calculator window. Add event handlers. All buttons must function.

Example of the output:

  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
Courses’i keskkonna kasutustingimused