Java

Times table in Java

In this tutorials will  teach you how to make a times table in java step by step. This step is very helpful for maths teachers.

Below Example Shows 2 times and 3 times tables enter the number on the text field click Add button Calculate and display the Tables.

i created the Method Table i wrote the following code.

public void Table()
    {
        
    DefaultListModel<String> listModel = new DefaultListModel<>();
   
    int i = 1;
    int number =  Integer.parseInt(txtNum.getText());

    while(i <= 10)
    {
        listModel.addElement(number + " x " + i + " = " + number*i  );
        i++; 
        
    }
        jList.setModel(listModel);
   }

After that call the Method on the Button Event.

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) 
{                                               
 Table();
}

 

 

admin

Recent Posts

Registration with image upload Java Jdbc(Download Source code)

Introduction In this section, we will guide you step by step in the development of an image upload registration system in Java using MySQL and JDBC. In the application, users register…

4 days ago

Touchable shop Pos system using Java

The Touchable Shop POS (Point of Sale) system is a sophisticated software solution developed using…

4 weeks ago

Build Your First Responsive Login Form Using HTML and CSS FlexBox

Creating a responsive login form is a crucial skill for any web developer. In this…

4 weeks ago

Build Crud API with Laravel 12

In this tutorial will teach  Laravel 12 CRUD API  by step. Laravel  10 CRUD Application …

1 month ago

laravel 12 image upload tutorial

In this lesson we talk about laravel 12 image uploading and display the image step…

1 month ago

Laravel 12 CRUD Application

In this tutorial will teach Laravel 12 CRUD Application step by step. Laravel  12 CRUD…

1 month ago