Java: Most Popular Articles
An example Java class for building a simple GUI application. This program corresponds to the Coding a Simple Graphical User Interface - Part I
Learn how to generate random numbers using the java.util.Random class.
Follow these steps if you want to find out if your computer is 32-bit or 64-bit.
This program creates a simple calculator that performs addition and subtraction. It highlights how to implement the ActionListener interface in three different ways.
Throughout the lifetime of a variable its value might change many times. But what if you know the value will never change? Or more importantly you want to make sure it can't change? This is when you need to use a constant.
The use of variables is key to any program. Learn how to declare and initialize variables in Java.
In object-oriented programming sometimes it's necessary to provide access to the private fields of an object. The use of accessors and mutators are a way to enable that access.
Cannot Find Symbol is a compile-time error.
Using standard Java naming conventions will increase the readability of your code and make it easier to maintain.
How to use JFrame to create a simple window for a Java application.
Are you ready to start programming in Java? Follow this step-by-step tutorial to learn how to write, compile and run Java programs. Page 4.
An example program showing how to use the JTable class
When a new instance of an object is created the constructor method is called. Examples of how to create constructor methods in Java are discussed here.
Example Java program code for how to make simple message dialog boxes using the JOptionPane class.
An example Java program showing how to use the JProgressBar
An example program showing how to implement the KeyListener interface.
: Aggregation is a relationship between two classes that is best described as a "has-a" and "whole/part"
Example Java code to show how the GridLayout, the BorderLayout and the BoxLayout can be used to make a customizable graphical user interface for a simple calculator.
Follow this step-by-step guide to learn how to design and create an object. Page 6.
How to convert Strings to numbers and back again.
Learn how to use the JOptionPane class to make a simple message dialog box
Here you will find a list of words that you cannot use as identifiers in a Java program.
Follow this step-by-step tutorial to learn how to write, compile and run Java applets.
How to use the ArrayList class. Java.
Use the if-then and if-then-else statements when your program needs to make a simple decision about what to do next.
An example program to show the DefaultTableModel in action.
Find out what Java is, who created it, and why people choose to program with it.
Learn about object inheritance and how it can be used to create a relationship between objects that share common characteristics.
Make your first Java download the right one. Step-by-Step instructions on how to download the latest version of the JDK.
Example Java program code to make several different types of input dialog boxes using the showInputDialog method of JOptionPane.
An example JavaFX application to show how to build a simple graphical user interface. The interface is the same as those built using Swing in part 1 and NetBeans GuiBuilder in part two.
A look at how to use the GridLayout layout manager.
How to implement the Key Listener Interface.
Sometimes the random numbers to be picked need to be unique.
Use the switch statement when you want your program to chose between a number of alternative options.
How to make use of command-line arguments in your Java applications.
Fields can be shared across all objects of the same type through the use of the static modifier.
Example Java program code for creating a simple password dialog box.
Enhance the readability of your programs by using Java comments.
An example Java program showing a simple application using the BoxLayout.
Example Java program code to show how the JFileChooser class is used to present an open file dialog box and save file dialog box to a user.
A simple application showing how the CardLayout can be used to switch JPanels.
A method signature is part of the method declaration. It is the combination of the method name and the parameter list.
This example code shows how to simply switch between two JavaFX stylesheets.
An example program to show how to code a BorderLayout layout manager with assigned horizontal and vertical spacing.
Bring a sense of order to your classes through the use of packages.
Example code for reading and writing to a binary file one byte at a time.
An example program showing how to implement the three mouse event listeners
Understanding object-oriented programming is fundamental to becoming a truly great Java programmer. The key concepts of objects are discussed in this article.
Example Java code for a program which provides a user with options to change the alignment and spacing of components in a FlowLayout layout manager.
Static methods are created using the static keyword.
Find out how to use the showInputDialog method of the JOptionPane class to make different kinds of input dialog boxes.
An identifier is simply a name given to a package, class, interface, method, or variable.
The Java language provides eight primitive data types that define simple values a program can use.
Example code showing how the GridBagLayout layout manager can be used to position components.
An overview of the BorderLayout layout manager.
Learn about the Unicode standard, a global way to encode the characters that computers use.
The association relationship is a way of describing the fact that a class knows about, and holds a reference to another class.
How to delete, copy and move files using nio.2
There are three different types of exceptions a Java application might encounter.
The ActionListener interface is an event listener for actions performed by some graphical components.
The term composition takes on different meanings depending on the subject, and in Java it has its own meaning as well.
How to create a simple JavaFX FXML application using NetBeans and Scene Builder.
Example Java program code that shows the two static methods of the JColorChooser class in action to make a color chooser dialog box.
A step-by-step guide to manually coding a simple graphical user interface. Part two of this step-by-step shows how to code the same graphical user interface using NetBeans Gui Builder.
An object is an instance of a class.
A superclass is a class that has been extended by another class.
Example Java code showing the ItemListener event listener in action
Scope refers to the lifetime and accessibility of a variable. How large the scope is depends on where a variable is declared.
Step-by-Step instructions on how to install the latest version of the JDK.
Whilst learning Java the best way is to compile and run example code. Using multiple classes within a NetBeans project means you can keep all your code examples in one place and try them out independently of each other.
See if you can debug a piece of code that produces one of the most fundamental Java runtime errors.
Learn how to include the functionality of packaged classes into your programs.
String Literals are used for representing string values in Java code.
Reached end of file while parsing is a compile time error.
Find out about data encapsulation, the most important concept of object-oriented programming.
Example Java code showing how the ListView and ComboBox JavaFX controls can be used.
A Java program to show the String class in action.
Example Java code showing how the TreeView JavaFX control is used.
Some classes are designed not to be extended by other classes. Find out how to prevent a class being inherited by another.
Following on from the first article on generating random numbers in Java, find out how to generate random fractional numbers and boolean values.
An example Java application which allows the user to combine various JOptionPane options to show example dialog boxes.
How to make use of arrays. Java.
: The ternary operator "?:" earns its name because it's the only operator to take three operands . It
Implement the ActionListener interface as an Anonymous Inner Class. Page 6.
Concatenation describes the operation of joining two strings together.
A look at the most common properties of the FlowLayout layout manager.
Since Java 7 the version of Java for the Mac OS X now comes from Oracle.
Any application providing a secure environment for a user needs to be able to safely obtain the password for that user.
A look at the JavaFX ComboBox class.
An event listener receives and process events.
A class specifies the design of an object.
Java handles exception through the use of the try-catch-finally blocks
Example Java program code showing two ways to make a modeless dialog using JDialog.
java.lang.NoClassDefFoundError is a runtime error.
How to read and write to a text file one character at a time.
Before you start to learn Java, you need somewhere to write your programs. Here's a guide to using an IDE versus a text editor.
A variable is a container that holds values that are used in a Java program.
An overview of the DefaultTableModel Java class
Learn how to read bytes from a binary file one byte at a time.
Overloading is the ability to define more than one method with the same name in a class.
An example of how to use the JavaFX BorderPane layout
Things are a little different for Java developers on Mac OS X. Find out how Java fits in with Apple computers.
The void keyword denotes that a method does not have a return type.
Conditional operators are used to evaluate a condition that's applied to one or two boolean expressions.
The JColorChooser class is used to create a detailed color chooser dialog.
When coding in Java it's important to remember that Java is case sensitive. Here are some tips to avoid common case sensitivity pitfalls.
An example Java program showing how to implement a FocusListener interface
A look at the JavaFX TextField class
An event typically occurs when a user interacts with a user interface.
A look at the JavaFX Button class
Can you rewrite this Java code so that there is no longer an infinite loop?
Hexadecimal refers to a numbering system that has a base of 16. This means it uses all the numerals 0,1,2,3,4,5,6,7,8,9 as well as the letters A,B,C,D,E,F for each digit of a number.
This step-by-step guide shows how to build the simple GUI application created in Coding a Simple Graphical User - Part I using the NetBeans GUI Builder.
An overview of how to use the GridPane to make a table format.
A look at the JavaFX ListView class
A look at the JavaFX TreeView class
A look at the table model behind the JTable
When a new version of an API is released it's quite common for parts of it to become deprecated.
Here are the steps to disable (or enable) the Java plugin in a browser.
An overview of the JFileChooser class showing the most useful methods along with some usage tips.
Using a table model to create the JTable. Page 3.
Handling item events triggered by ItemListener event listener through selecting and deselecting items from a JComboBox.
By using the JDialog class you can create custom dialog boxes that can be modeless.
Looking at the JavaFX program structure. Page 2.
A look at the JavaFX RadioButton class
Turtles, magic and squares will conspire to test your logic in this exercise.
Source code refers to the programming instructions used to create an application.
Arithmetic operators perform the same basic operations you would expect if you used them in mathematics (with the exception of the percentage sign).
A basic look at the structure of a very simple Java program. This article gives a beginner a starting place for understanding the way the Java syntax builds to make a Java program.
See how to create a message dialog box when you want the user to confirm a message with a Yes or OK.
An example program showing how to create labels
In a method call the implicit parameter is the object the method belongs to.
An look at the JavaFX ToggleButton class
Example Java code showing the ToggleButton in action.
Parameters are the variables that are listed as part of a method declaration.
How to use the GridPane layout to place child nodes in a grid format.
Constructor chaining occurs through the use of inheritance.
How to make a progress bar using the JProgressBar class
How to use the Arrays class to manipulate Arrays
Java is a strongly typed programming language because every variable must be declared with a data type.
There are a number of layout managers designed to make it easy to control where the components of a graphical user interface are positioned.
An overview of the GridBagLayout layout manager.
The String class lets you create and manipulate Strings.
Find out what a dialog box is and how they can be an effective way to get the user’s attention.
How to implement a Focus Listener interface to a class to listen for focus events.
NetBeans is a sophisticated IDE that aims to help developers build any type of application.
A look at the JavaFX ChoiceBox class
How to implement the MouseListener by attaching it to a JLabel. Page 3.
Take the odd magic squares program one step further with another test of your programming logic.