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

Objektorienteeritud programmeerimine (Narva Kolledž) 2018/19 kevad

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

slides_s9.pdf

NB! The practical session exercises are always provided enough and to spare with an eye to fast / experienced students have exercises to solve. To this end, do not get upset if you do not get on all the task in class. Take your time and complete the tasks at home!

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.

An example of the program output:

Task 2. Flag

Upgrade the flag program of the 8th 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 the buttons must function.

An example of the program 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