Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

C# File & Directory Handling

Fig 1. About the Example

C# provides many utility classes to work with the file systems. The DriveInfo class will give us the information about a specific drive in the windows file system. Other similar classe DirectoryInfo provides information about the specific directory and all the file it contains. Similarly FileInfo class provides information about the file and File class provides API functions to perform File Copy and Move actions. In this example, we will explore File system access by using the dot net provided API functions.

Continue Reading →

JavaFx Default & Cancel Buttons

Fig 3. JavaFx Button Example

In the JavaFx framework, buttons play a crucial role in facilitating user interaction and triggering specific actions. Typically, users manipulate buttons by positioning their mouse cursor over them and clicking to initiate a desired action. It’s worth noting that a single container can contain multiple buttons, among which there can be a designated Default Button and a Cancel button. Upon pressing the Enter key on the keyboard, the default button’s handler is invoked, while pressing the Esc key

Continue Reading →

C# Anonymous Function Handler

Fig 3. Anonymous Delegate Handler Function

Let us say, we need to define a handler for the event and do not want to define a handler function in the class definition. In that case, one can go for the Anonymous Function Handler. We can define Anonymous Function Handler either using a Lambda Expression or using the Anonymous Delegate. In this example, we will try both the technique.

Continue Reading →

JavaFx Label with Mnemonic

Fig 1. JavaFx Label Control Mnemonic

A Label can be placed before the other UI node or on top of the UI node. A Label cannot be focused on. This means, we cannot use the Tab key to set the focus to a Label. Even though it will not receive focus, it can transfer the focus to other controls and in this example, we will set Mnemonic to a label control so that it will transfer the focus to another control.

Continue Reading →

Setup Wildfly Eclipse Neon for JavaEE

Fig 1. JavaEE JCP JSR Overview

JavaEE stands for Java Enterprise Edition, and it is a web development framework. JavaEE is a specification developed on top of Java SE (Java Standard Edition). In this Example, we will setup Eclipse & Wildfly. Have a look at the depiction below:

The corporate unit comes-up with the generalised specification and submits it to the JCP (Java Community Process) for review. The JCP members reviews the JSR (Java Specification Requirement) and asks for clarification and in the process, they improve the JSR. The reviewed JSR will be published as JavaEE requirement for the next release.

Continue Reading →