java

Language Use List: Groovy Enters Top-20; C Still on Top

Submitted by jproimakis on
Dramatic jumps over the past year have seen the Groovy language break into the top-20 list of programming languages, reaching the 18th spot, according to this month’s Tiobe index of programming language popularity. A dynamic language for the Java Virtual Machine, Groovy has managed to jump over 35 spots since last year, when it was ranked at the 53rd position. Though its use percentage is at a

How to Use OOP (Object Oriented Programming) In Java

Submitted by Yorkiebar on
Introduction: Welcome to my tutorial on how to use OOP (Object Oriented Programming), I am using Java to do this however, the principle applies for OOP in general. Steps of Creation: Step 1: First I have created a simple project in Java IDE called Eclipse. I have two classes, one called Main to host the form/frame/window of the application and handle the output, and a Game class which is going to

How to Create a Notepad Project in Java

Submitted by Yorkiebar on
Introduction: This tutorial is on how to create a simple Notepad application in Java. The program will save and open files as well as have close and new functions. Steps of Creation: Step 1: First we want to create two classes; Main and Grid. In our Main class we will have our JFrame (which is the window of the application). The JFrame will lead to our Grid class which will contain the Notepad

Styling Java Buttons & Labels with HTML tags

Submitted by mehfuza on

Introduction:

Java buttons and labels support using different HTML (Hyper Text Markup Language) tags. HTML is Web page development language where as Java is Programming language but still Java executes the HTML tags and displays the output according to the HTML tags. These tags can be used to insert new line on the button or labels or styling the text on the buttons and labels. Text Area does not support executing HTML tags it displays the tags as it is. Buttons and label support following HTML tags.

Tags Supported by Labels and Buttons

1.

Cursor and Combo Box Demo in Java

Submitted by mehfuza on

Introduction:

In this tutorial we will see changing cursor when it is selected from Combo Box in Java. You will learn about cursor as well as JComboBox. The position of the mouse is represented on the computer's screen by a small image called a cursor. It has a hot spot, which is a Point that specifies the pixel within the image that corresponds to the exact point on the screen where the mouse is pointing. The Cursor class has many predefined cursor which can be used with Cursor.getPredefinedCursor(code) method. Where code represent type of cursor.

Simple Image Viewer in Java

Submitted by mehfuza on
Introduction In this tutorial we will learn how to display picture in Java Application. There is difference between how a picture displayed in application and applet. For application we require drawImage() method which draws the image to specific component and not the entire frame. Implementation Step 1: Creating the components We require a label, text field where user will enter name or address

Creating Executable Program in Java

Submitted by mehfuza on
Executable software can be created using JAR(Java Archive) utility. Once you create jar file of the program it can run on any machine having JRE(Java Runtime Environment ) installed. JAR file should contain the .class files and resource such images, audio or any other files required. Including only .class files makes the code private. It can also include .java files, the source code of the program. Following are the commands to be run at Command Prompt or Terminal in Linux. Step 1: Compiling the Java Programs First compile all the Java programs of an application.

Simple Editor in Java

Submitted by mehfuza on

Introduction

This simple editor has only one menu with New, Open, Save, Exit option. It requires JMenuBar, JMenu, JMenuItem, ActionListener, File related classes. This tutorial demonstrate creation of menu and reading and writing the files. Once user clicks on open menu then Open dialog box is displayed and File is displayed in the display area. This simple editor can be created easily with following steps. File reading and writing part is similar to previous tutorial.

Implementation

Step 1: Designing the Menu The class is application so it extends JFrame.

Simple Web Browser in Java

Submitted by mehfuza on
In this tutorial we will see how to create a simple web browser. It contains an address bar where a user can type the address and a go button which when clicked loads the web page. For displaying the web pages we require JEditor Pane and HyperlinkListener is required to respond when the user clicks on a link in the document. Following are the steps for creating the web browser. Step 1: Defining the constructor of the class The main class extends the JPanel.

Reading from and Writing to a Text File in Java

Submitted by mehfuza on
Introduction: This tutorial demonstrate the method of reading from and writing to a text file in Java. Java has two type of files: Binary and Text. Text file is processed as a sequence of characters where as Binary file is processed a sequence of bytes. This application has 4 JButtons for reading, writing, exiting, and clearing the Display Area. Also It has a display area where we can type the data to be written to text and in the same area content from file are displayed. Step 1: Creating GUI Components Create the four buttons, label, text area and text field.