This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AreaChartDemo extends Application { | |
public static void main(String[] args) { | |
launch(args); | |
} | |
private Point2D firstClick = null; | |
private float SND(double x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hbox.children += createConfiguredImageView(path) | |
private fun createConfiguredImageView(path: URI) = ImageView(Image(path.toExternalForm())).apply { | |
fitHeight = 600.0 | |
isPreserveRatio = true | |
opacity = 0.7 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val imageView = ImageView(Image(path.toExternalForm())) | |
imageView.fitHeight = 600.0 | |
imageView.isPreserveRatio = true | |
imageView.opacity = 0.7 | |
hbox.getChildren().add(imageView) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hbox.children += ImageView(Image(path.toExternalForm())).apply { | |
fitHeight = 600.0 | |
isPreserveRatio = true | |
opacity = 0.7 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun handleNullable() { | |
val customer: Customer? = database.fetchCustomer(customerId) | |
val customerName:String = customer?.let{it.getName()}?: "Mr. Nobody" | |
println("The customer name is $customerName") | |
} | |
fun betterHandleNullable() { | |
println("The customer name is " + database.fetchCustomer(customerId)?.name ?: "Mr. Nobody") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sample { | |
var intField: Int = 0 | |
} | |
fun UseSample() { | |
val sample = Sample() | |
sample.inField = 3 | |
println(sample.intField) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sample { | |
var intField: Int = 0 | |
} | |
fun UseSample() { | |
val sample = Sample() | |
sample.setIntField(3) | |
println(sample.getIntField()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sample { | |
private int intField = 0; | |
public int getIntField() { | |
return intField; | |
} | |
public void setIntField(int newValue) { | |
intField = newValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val _$PROPERTY$: ObjectProperty<$PROPERTY_TYPE$> = SimpleObjectProperty($INIT_VAL$) | |
var $PROPERTY$: $PROPERTY_TYPE$ | |
get() = _$PROPERTY$.get() | |
set(value) = _$PROPERTY$.set(value) | |
fun $PROPERTY$Property() = _$PROPERTY$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KotlinClass() { | |
private val _nickName: ObjectProperty<String> = SimpleObjectProperty("") | |
var nickName: String | |
get() = _nickName.get() | |
set(value) = _nickName.set(value) | |
fun nickNameProperty() = _nickName | |
} | |
fun main(args: Array<String>) { |
NewerOlder