This file contains hidden or 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
/** | |
* This method displays the given price on the screen. | |
*/ | |
private void displayPrice(int number) { | |
TextView priceTextView = (TextView) findViewById(R.id.price_text_view); | |
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number)); | |
} |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
package Junit; | |
import javafx.application.*; | |
import javafx.scene.*; | |
import javafx.scene.layout.*; | |
import javafx.scene.paint.*; | |
import javafx.scene.shape.*; | |
import javafx.stage.*; | |
public class AlwaysRectangle extends Application { |
This file contains hidden or 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
import javafx.application.*; | |
import javafx.event.*; | |
import javafx.scene.*; | |
import javafx.scene.input.*; | |
import javafx.stage.*; | |
public class BounceBallControl extends Application { | |
/** | |
* The main method is only needed for the IDE with limited | |
* JavaFX support. Not needed for running from the command line. |
This file contains hidden or 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
import javafx.application.*; | |
import javafx.event.*; | |
import javafx.scene.*; | |
import javafx.scene.input.*; | |
import javafx.stage.*; | |
public class BounceBallControl extends Application { | |
/** | |
* The main method is only needed for the IDE with limited | |
* JavaFX support. Not needed for running from the command line. |
This file contains hidden or 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
import javafx.application.*; | |
import javafx.event.*; | |
import javafx.scene.*; | |
import javafx.scene.input.*; | |
import javafx.stage.*; | |
public class BounceBallControl extends Application { | |
/** | |
* The main method is only needed for the IDE with limited | |
* JavaFX support. Not needed for running from the command line. |
This file contains hidden or 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
import javafx.animation.*; | |
import javafx.beans.property.*; | |
import javafx.scene.layout.*; | |
import javafx.scene.paint.*; | |
import javafx.scene.shape.*; | |
import javafx.util.*; | |
public class BallPane extends Pane { | |
public final double radius = 20; | |
private double x = radius, y = radius; |
This file contains hidden or 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
import javafx.animation.*; | |
import javafx.beans.property.*; | |
import javafx.scene.layout.*; | |
import javafx.scene.paint.*; | |
import javafx.scene.shape.*; | |
import javafx.util.*; | |
public class BallPane extends Pane { | |
public final double radius = 20; | |
private double x = radius, y = radius; |
This file contains hidden or 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 static int parseInt(char[] charArray) { | |
int sum = 0; | |
for (char c : charArray) { | |
sum = (sum * 10) + (c - '0'); | |
} | |
return sum; | |
} |
This file contains hidden or 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
[package]>java.util.* | |
Random | |
>Methods: | |
nextInt(); | |
nextFloat(); // etc ... | |
GregorianCalendar | |
>Methods: | |
calendar.get(constant); | |
calendar.setTimeInMillis(long); | |
calendar.setTime(Date); |
OlderNewer