Tuesday, April 8, 2025

Importing SQL Libraries Into JavaFX with Maven: A Step-by-Step Guide

 Preliminary of Java:

Java is a powerful and versatile programming language that is widely used. Java is designed around the concept of “objects”, which are bundles of data and behavior, a concept that promotes modularity and code reusability. Java is also used in a wide range of applications, including web applications, mobile applications (especially Android), enterprise software, big data processing, embedded systems, and game development. Java code also can run on various operating systems.

Preliminary of Java with Maven:

Java with Maven or another word can be said that Apache Maven is a powerful build automation tool, which is mainly used for Java projects.

Maven has the objective to simplify the build process by providing a standardized way to manage dependencies, automatically download and include the library, manage project structure with the aim to make easier for developers to understand and work on projects, and build the project into JAR file.

Preliminary of SQL:

SQL, which stands for Structured Query Language, is a domain specific language that is used to manage and manipulate relational databases. Relational databases are organized into tables consisting of rows and columns, each of which can have relationship that allow for efficient retrieval and management of data. SQL is the language used for interaction between programs with relational databases. SQL allows us to extract specific information from the database (retrieve data), add new records to the database (insert data), change existing records (update data), delete tables and records from the database, define data (create modify and delete database structures), and manage user access and privileges (control data).

Preliminary of JavaFX:

JavaFX is a next generation open-source Java programming for client application platform that supports application development based on desktop, mobile and embedded systems.

A Step-by-step guide on how to import SQL libraries into JavaFX:

The background motivation why this tutorial needs to be provided is because there is a problem when the “import java.sql.*;” is implemented then the error warning will show the information about: package java.sql is not visible (see Figure 1).


Figure 1 The importing java.sql error.


The solution to handle this problem is composed of 2 steps that have to be done by the programmer.

The first step is to add the Maven repository artifact related to the MySQL connector to the pom.xml file, where the detailed information can be accessed in this link : https://mvnrepository.com/artifact/mysql/mysql-connector-java see Figure 2.

Figure 2 Adding the Maven repository to the pom.xml file.

The second step is to add “requires java.sql;” syntax to module-info.java (see Figure 3).

Figure 3 Tutorial on adding “requires java.sql;” syntax to module-info.java.

Now that the process of Figure 3 has been done, the import of java.sql can be done on App.java or any other Java class.






Tuesday, October 1, 2024

Greyscale Image : A Computer Vision Perspective

 



Figure 1. The example of grayscale image

Not only in the result of the image that is printed on the paper, in the digital field there are images that provide only no colour or known as greyscale image. The grayscale image (see Figure 1) can be realized by composing on each pixel with the difference of white levels. The low level of grayscale image especially on the pixel scale means the dark level or will appear as black color, otherwise the high level of grayscale will make the image appear as white. In the digital image, for each pixel of the greyscale image, it is represented by an integer number with the level ranging from 0 to 255. 0 is black and 255 is white. This integer number can also be represented in binary number with the amount of 8 bits. The number 0 can be represented starting from the binary number 0b0000000000 until the maximum level number is 255, or it can be represented in binary number as 0b1111111111. The prefix of 0b means as binary number format. The grayscale image in the digital domain is defined as array data with the length of the matrix is arranged by 2 dimensions array.

Saturday, September 28, 2024

Pixel Perfect: A Deep Dive into LCD, LED, and AMOLED Displays

 

Figure 1. The illustration of the monitor display when zooming down to pixel level will find the fact that each pixel is made up of 3 sub-colours.


Have you ever wondered what is going on beneath the surface of your TV, your computer monitors or the screen of your mobile phone? In this blog we take a microscopic journey into the world of screen technology, zooming in on the individual pixels that make up LCD (Liquid Crystal Display), LED (Light-Emitting Diode Display) and AMOLED (Active-Matrix Organic Light-Emitting Diode Display) screens. Between LCD, LED, and AMOLED components have the same task as display output to provide a visual output for the Brain ware. LCDs, LEDs and AMOLEDs have the same pixel structure where each pixel consists of three sub-pixels (red, green, and blue). Each sub-pixel is controlled by transistors to give the variation of brightness level for each sub-pixel. As shown in Figure 1, each pixel has 3 sub-pixels. It means if the LCD has the resolution of 1366 x 768 pixels, the LCD has 1366 x 768 x 3 or amount 3.147.264 subpixels that must controlled. The transistor that controls the brightness of the sub-pixels is in the range between 0 and 255. If the sub-pixel is triggered with the 0 level it will make the sub-pixel to be off, otherwise if the sub-pixels are triggered with the maximum number of 255 it will make the sub-pixels to be on and shining very brightly. The combination of colour primers that are on in each level will give the variation of spectrum colour. If three sub-colours in every pixel is triggered with 0, the colour of the pixel will appear black, otherwise, if the three sub-colours with the level trigger is 255, the light colour on the pixel will appear white colour.