JavaFX Intro Flashcards

1
Q

Hoe maak n mens seker jy het al die libraries vir JavaFX?

A

Wel, nadat jy die JavaFX SDK install het, moet jy die JARs select.
So basies file, Project Structure, Global Libraries, select dan al die JARs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

By die JavaFC goed, wat se module storie is dit om seker te maak jy het die regte JARs?

A

Right click op die source folder, module settings, global libraries, right click op jou FX goed en dan moet jy dit busit by die module?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

As jy n JavaFX app het, war word outomaties extend?

A

Application class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In basiese JavaFX, hoe lyk die hierargie van die GUI?

A

Stage - Gridpane - Scene

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Hoe skep n mens n grid pane vanaf java?

A

GridPane root = new GridPane();
En dan is daar seker basiese funksies:
SetAlignment(Pos.CENTRE)
SetVgap en setHgap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Hoe dal jy via java/compiler,n nuwe label skep? Byvoeg en die kleur verander?

A

Label greeting = new Label (String);
Root.getChildren().add(greeting);
Greeting.setTextFill(Color.GREEN)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Hoe sal jy via Java/compiler die font van n label verander?

A

greeting.setFont(Font.font(“Times New Roman”, FontWeight.BOLD, 70));

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

So hoe lyk n FXML file se baiese struktuur?

A

<GridPane ##@&#^>
En dan alles wat aan die gridpane behoort

</Gridpane

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In FXML, hoe skep mens die gridpane?

A

<GridPane fx:controller=”com.example.layouts.HelloController” xmlns:fx=”http://javafx.com/fxml” alignment = “top_left” hgap = “50”, vgap = “50” gridLinesVisible = “true”>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Wat is column constraints en waar define ek dit in FXML?

A

Jy raak dan prescriptive itv jou grid layout, so na jy die pane gegenerate het, en voor jy enigiets add, kan jy:

<columnConstraints>
<ColumnConstraints></ColumnConstraints>//dit doen jy vir die hoeveelheid kolomme wat jy het
</columnConstraints>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Hoe add jy n button in FXML?

A

Na jy die grid geskep het, kan jy:
<Button text=”wat moet display”, GridPane.rowIndex = “0” GridPane.columnIndex = “1”/> ensovoorts.
Die goed sal dan outomaties geplaas en gesize word, onthou ook dat vgap en hgap die spasies tussen die buttons bepaal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Hoe sit n mens n label in by FXML met n seker kleur en font?

A

Belangrik om te onthou, font word apart definieer:
<Label text=”wat jy wil display” textFill = “green”

<font>
<Font></Font>
</font>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly