Posts

Showing posts from 2017

Web Weather Application

Image
This one is not really finished yet. I still want to make a daily or/and hourly forecast. That is why so much space was left empty. Model was created from  my weather application , that I've done before, and Controller and View were developed rather quickly which resulted in not so spectacular UI and functionalities. djordje.webweatherapp.model.Weather.java /* * Web Weather Application - Maven / Spring Web MVC */ package djordje.webweatherapp.model; import net.aksingh.owmjapis.CurrentWeather; import net.aksingh.owmjapis.OpenWeatherMap; import org.json.JSONException; /** * * @author djordje gavrilovic */ public class Weather { private int cityID; private String cityName; private String description; private String temperature; private String pressure; private String humidity; private String wind; private String iconID; public int getCityID() {return cityID;} public void setCityID(int cityI...

Encoder / Decoder

Image
Just for fun. String encoding/decoding. JavaFX encodeco1.EncoDeco1.java package encodeco1; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.net.URL; import javafx.application.Application; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.control.TextArea; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.HBox; import javafx.stage.FileChooser; import javafx.stage.Stage; /** * * @author Djordje Gavrilovic */ public class EncoDeco1 extends Application { @FXML private AnchorPane root; @FXML private HBox hBox1; @FXML private TextArea inputTa; @FXML private TextArea outputTa; private Stage primaryStage; @FXML public void initialize() { hBox1.prefWidthProperty().bind(root.widthProperty()); } @FXML private ...

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...

Simple mail client

Image
UPDATE : Just changed colors. Blue screen fetish is not working anymore :D I have a blue-screen fetish. Yes, since old QBasic IDE. So I like it, and I find it appropriate for this kind of a...low-level functionality software. When, and if, this app should grow, with it's usability, so will its' GUI :) It can read newest mail ( text ) and send one. I've used Task just for a sake of ProgressIndicator. bebicamc02.BebicaMC02.java 1: /* 2: * Bebica Mail Client 3: * ver 0.2 4: */ 5: package bebicamc02; 6: 7: import java.io.IOException; 8: import java.net.URL; 9: import java.util.Properties; 10: import javafx.application.Application; 11: import javafx.concurrent.Task; 12: import javafx.fxml.FXML; 13: import javafx.fxml.FXMLLoader; 14: import javafx.scene.Scene; 15: import javafx.scene.control.*; 16: import javafx.scene.layout.AnchorPane; 17: import javafx.stage.Stage; 18: import javax.mail.*; 19: import javax.m...

Forthz - web browser

Image
Because we all do. :) I've enjoyed playing with it but... I will never use JavaFX without FXML again! It's simple, has working basic functionalities. Of course, a list of functionalities that it doesn't have...would be...quite large! But it's something to play with... forthz.Main.java 1: package forthz; 2: 3: import java.util.Optional; 4: import javafx.application.Application; 5: import javafx.application.Platform; 6: import javafx.beans.value.ObservableValue; 7: import javafx.collections.ObservableList; 8: import javafx.concurrent.Worker; 9: import javafx.event.ActionEvent; 10: import javafx.event.EventHandler; 11: import javafx.geometry.Pos; 12: import javafx.geometry.Rectangle2D; 13: import javafx.scene.Scene; 14: import javafx.scene.control.Button; 15: import javafx.scene.control.ChoiceBox; 16: import javafx.scene.control.Label; 17: import javafx.scene.control.TextField; 18: import javafx.scene.control....

Registration of internet package sales

Image
It's a simple, MVC, JavaFX, single scene app. Actually it's a form for registering the sale of an internet package with a ListView of previous purchases. The internet package consists of few parameters : speed, flow, duration of the contract, id, name and surname of the user and user address. The functionalities are: review all sales , adding new sales and deletion of existing sales. jfxas1.Main.java 1: /* 2: * JavaFX - Registrovanje prodaje internet-paketa 3: */ 4: package jfxas1; 5: 6: import java.net.URL; 7: import javafx.application.Application; 8: import javafx.fxml.FXMLLoader; 9: import javafx.scene.Scene; 10: import javafx.scene.layout.BorderPane; 11: import javafx.stage.Stage; 12: 13: /** 14: * 15: * @author djordje gavrilovic 16: */ 17: public class Main extends Application{ 18: 19: public static void main(String[] args) { 20: launch(args); 21: } 22: 23: @Override ...