All Code Examples

access file information

Jul 28, 21 0 7 0

This code example demonstrates how to access file information using the File class. In this code we used Jtabel and Table model to display info of each file in a selected directory. By hassan mugabo Intermediate

jlabel demo with country flags

Jul 27, 21 0 4 0

This code example shows how to use JLabel by displaying countries flag along with their respective names in a grid that uses GridLayout manager. In this code we used a simple json file containing country names and converted it into A HashMap that we used to get abbreviated name that match a given f By hassan mugabo Intermediate

java string manipulation

Jul 27, 21 0 12 0

This code example demonstrates how to manipulate strings in java programming language.The program uses a JTextPane to search and highlight string portions found by searching its content.It also replaces string portions and a applies a highlight color on a selected text. By hassan mugabo Advanced

jswing font manager

Jul 22, 21 0 8 0

In this code example we want to use the available system fonts to change the font family of a JTextArea. we will also change its style and size.Our class extends JPanel to layout its components. By hassan mugabo Intermediate

Triangular asterisks part 1

Jul 07, 21 0 20 0

This simple program that prints a triangle of asterisks that points up,down, left and right demonstrates how to use the for_loop to control the flow of execution in java. By hassan mugabo Simple

jtree code example

Jun 10, 21 0 130 1

This code example shows how to use JTree component in java. A JTree tree component allows you to work with hierarchical data such as displaying a directory and all its sub-directories. By hassan mugabo Advanced

vue conditional rendering

Jun 09, 21 0 113 1

This code example shows how to use Vue contional rendering directives such as v-if and v-show to load or show elements already exist in the document. You can play with the check-boxes to load or hide planet details of the four terrestrial solar planets By hassan mugabo Simple

how to write jquery plugin

Jun 03, 21 0 88 1

This code example shows how to write a jQuery plugin. In this code, I have created few functions that make the plugin shuffle a bunch of images. By hassan mugabo Intermediate

how to connect to a mysql database in java

Jun 03, 21 0 37 1

This code example shows how to establish a connection to a mysql database. To make sure this code works in your case, you must include the mysql connector for java into your project Referenced Libraries in VSCode. By hassan mugabo Intermediate

how to declare methods on a vue instance

Jun 01, 21 0 30 1

This is a simple Vue code example that shows how to work with methods and class and event binding.I declared three recursive methods on the Vue instance to determine prime, cubic and square numbers. By hassan mugabo Simple