How to fix multiplication table using JOption Pane?

nested loop java multiplication table
java program for multiplication table from 1 to 10 using while loop
multiplication table in java using array
multiplication table java
write a program that prints a multiplication table for numbers up to 12
how to display table in java
multiplication in java
how to make a table of numbers in java

I am trying to make a multiplication table with the user's input of the desired table and how many numbers he/she wants to display (for example the input of 2 for table and 5 for numbers would give 2,4,6,8,10).

I have tried the following but it wont give the desired output.

public class MultiplicationTable {
    public static void main(String[] args) {
        Scanner sc = new Scanner(;
        int num = Integer.parseInt(JOptionPane.showInputDialog("Enter a number."));

        int value = Integer.parseInt(JOptionPane.showInputDialog("Enter number of times."));

        printTable( num,  value);

    private static void printTable(int num, int value) {
        int [] table = new int[value];
        for(int i = 0; i<=value-1; i++) {
            table[i] = num*i;

It is printing: [I@3d494fbf when it should be printing a multiplication table.

Try java.util.Arrays.toString(int[]) API.

Inside your printTable(), you can print like this:


Multiplication Table Using Swing, Display a multiplication table // adapted from the Liang textbook import javax.swing.JOptionPane; public class MulTable { /** Main method  Re: Need help with JOptionPane and multiplication tables The windowing system of Windows 10 is keeping Eclipse on top of your message dialog. So the dialog is opening, you just won't see it unless

When you use System.out.println to print an object (like your array) what really happens is a call to the toString method of the object.

Now according to the toString method of the Object class:

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

getClass().getName() + '@' + Integer.toHexString(hashCode())

If you'd like to print the contents of the Array instead try System.out.println(Arrays.toString(table));

Multiplication table exercise, 49 Program Displaying the Multiplication Table 1 50 import from CPSC 210 at University JOptionPane; public class MulTable { /** Main method */ public static void Example: Finding the Greatest Common Divisor Problem: Write a program​  Not sure what I'm missing here. I am trying to format my output using JOptionPane using a single window and I can't figure out what I'm doing wrong. Fairly certain the problem has to do with me trying to create a new table each time I run through the for loop. This is not what I'm trying to do, but I'm not sure what else to do.

Put Print line inside loop Like this:-

for(int i = 1; i<=value-1; i++)
    table[i] = num*i;

The Value '[I@3d494fbf' your program is printing is 'table' array memory path.

49 Program Displaying the Multiplication Table 1 50 import, Re: Need help with JOptionPane and multiplication tables. Build the string in the loop, then outside the loop open the dialog: Java Code:  Write a Java Program to Print Multiplication Table using For Loop, and While Loop with example Java Program to Print Multiplication Table using For Loop This Java program for Multiplication table allows the user to enter any integer value, and prints the multiplication table from that number to 9 using For Loop.

Need help with JOptionPane and multiplication tables, i want the whole table output in a same dialogbox. my problem is i got table JOptionPane; class jtable1 { public static void main(String args) { int res=0; timesTable, "Times Table For " + tableRequested, JOptionPane. We'll use the four operations: multiplication, division, addition, and subtraction for these tables. Quick Vocabulary Before we get started on this lesson, let's go over some necessary vocabulary

table using joptionpane, Open the file named Multiply from the Chapter04 folder of the Data Disk. them to enter each answer, multiplying their table value by each integer from 0 to 12. Respond to the prompts by entering the correct answers as integers. error message using the System.out.println() method or a JOptionPane message box. 9. import javax.swing.JOptionPane; void setup { int max, column, row, product, x = 20, y = 20; size (500, 500); background(0); do { String answer = JOptionPane.showInputDialog("How many rows would you like in your times table?"+ " Enter a number between 1 and 16."); max = Integer.parseInt(answer); } while (max < 1 && max >16); // Display the header row of the table.

Java Programming: Comprehensive Concepts and Techniques, in this video you can see how to use multiplicaion in JOptionPane in java. if or more Duration: 3:38 Posted: Jan 31, 2018 using tab spacing in JOptionPane.showInputDialog . Senaca Boyd. Greenhorn Posts: 9. posted 13 years ago \t does not appear to be working with showInputDialog. How can