Posts

Showing posts with the label java

Puzzle

Image
It's fun making games. Even this simple. Wish I had rights for this awesome background pic. Main.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 package mhgpuzzletest; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Image; import java.awt.LayoutManager; import java.awt.Point; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.JButton; import javax.swing.JFrame; /** * * @author djordje gavrilovic */ public class Main extends JFrame { static JButton reset; static Main frame; static Cursor cursor; public Main() throws IOException { // custom-cursor. not full color on Linux Toolkit tk = Toolkit.getDefaultToolkit(); Image img = ImageIO.read(getClass(...

Simple weather application

Image
Weather app powered by OpenWeatherMap API. Done with JavaFX/fxml. Libs: java-json.jar, owm-japis-2.5.0.5.jar. model.WeatherModel.java /* * MyWeather App with OpenWeatherMap API */ package model; import javafx.beans.property.LongProperty; import javafx.beans.property.SimpleLongProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import net.aksingh.owmjapis.CurrentWeather; import net.aksingh.owmjapis.OpenWeatherMap; import org.json.JSONException; /** * * @author djordje gavrilovic */ public class WeatherModel { private final LongProperty cityID = new SimpleLongProperty(this,"cityID"); private final StringProperty cityName = new SimpleStringProperty(this,"cityName"); private final StringProperty description = new SimpleStringProperty(this,"description"); private final StringProperty temperature = new SimpleStringProp...