java

JTextArea Component in Java GUI

Submitted by donbermoy on
This is a tutorial on how to use the JTextArea Component of Java. JTextArea is different from JTextField. Unlike JTextField that will only be used for one line of text, the JTextArea Component can hold more than one line to display text. So, now let's start this tutorial! 1. Open JCreator or NetBeans and make a java program with a file name of jTextArea.java. 2.

How to Zip your File using Java

Submitted by donbermoy on
Today, I will teach you how to create a program that will zip your file using Java. We all know that zip is a popular compression format that also contains one or more files that have been compressed into the ZIP format. So, now let's start this tutorial! 1. Open Notepad. Encode any data in there and save it to the same folder with your java program and named it as READ FIRST.txt (Note: you can

How to Delete Files using Java

Submitted by donbermoy on
In this tutorial, we will create a program that can delete files using Java. We are done with creating files, appending, and reading data inside of a file. So, now let's start this tutorial! 1. Open Notepad. Encode any data in there and save it to the same folder with your java program and named it as data.txt. 2. Open JCreator or NetBeans and make a java program with a file name of deleteFiles

Read Data from a Text File using Java

Submitted by donbermoy on
Today, I will teach you how to read data from a text file using Java. We're done with creating files and writing/appending files, so now we will proceed to reading of data from any files but here we just use the text files or .txt file extension. So, now let's start this tutorial! 1. Open Notepad. Put any data in there, for example, i have write " Sourcecodester is the best!". Save it to the same

Compute Number of Days to Months and Days in Java GUI

Submitted by donbermoy on
This tutorial will teach you how to compute a given number of days to months and days using Java GUI. For example we input a number of days of 65, the equivalent months and days is 2 months and 5 days. So, now let's start this tutorial! 1. Open JCreator or NetBeans and make a java program with a file name of monthsDays.java. 2. Import javax.swing package. Hence we will use a GUI (Graphical User Interface) here like the inputting the number of days.

Compute Square Root of a Number in Java GUI

Submitted by donbermoy on
In this tutorial, you will learn how to compute a square root of a number using Java GUI using Math.sqrt function. We all know that square root are number that when multiplied by itself gives a given number. Now let's start this tutorial! 1. Open JCreator or NetBeans and make a java program with a file name of sqrRoot.java. 2. Import javax.swing package.

How to Append Data to Text File in Java

Submitted by donbermoy on
In this tutorial, i will teach you how to append data to a text file using Java. I already had tutorial in creating a file, and now, we will put a data to this file. So, now let's start this tutorial! 1. Open JCreator or NetBeans and make a java program with a file name of AppendData.java. 2. Import java.io package.

Reverse a Number in Java GUI

Submitted by donbermoy on
In this tutorial, i will going to teach you how to create a program in Java GUI that reverses an inputted number. Now let's start this tutorial! 1. Open JCreator or NetBeans and make a java program with a file name of reverse.java. 2. Import javax.swing package. Hence we will use a GUI (Graphical User Interface) here like the inputting the number.