Write a java program to display multiplication table in a
Frame.



Write a java program to display multiplication table in a Frame...

Answer / hardik viradiya

import java.awt.event.*;
import javax.swing.*;
import java.awt.Graphics;
import java.awt.*;
public class MatrixMulFrame extends Frame
{
public static void main(String[] args)
{
MatrixMulFrame fm = new MatrixMulFrame();
fm.setSize(900, 600);
fm.setVisible(true);
fm.repaint();
}
public MatrixMulFrame()
{
}
public void paint(Graphics g)
{
for(int i=1;i<=10;i++)
{
for(int j=1;j<=10;j++)
{
String str = Integer.toString(i*j);
g.drawString(str,(i*30),10+(j*30));
}
}
}
}

Is This Answer Correct ?    14 Yes 12 No

Post New Answer

More J2SE Code Interview Questions

how to store and retrive a set of values without using an array

8 Answers   FCS, HCL, Maximus,


write a c program which takes 20 numbers in an array as input from user and rearrange them in two different array defining even or odd

0 Answers  


we compile any program bu c:/>javac prog.java and run as c:/>java prog Here what's the meaning of c in javac. We have java Interpreter but not compiler.Then why we have to use javac. Please answer this question?

2 Answers  


does anyone know the code to display a triangle using a applet?

1 Answers  


Is it possible to define marker interface in java.If possible then how to define user defined marker interface?

1 Answers   Tech Mahindra,






Why we r using String args[] in main() even though v r not passing any arguments in command line?

2 Answers  


A game that has five levels of play has the score for each level stored in an array. You are to write a program that goes through that array and finds: a) the minimum score, and the level at which it occurred b) the maximum score, and the level at which it occurred c)the average score for all five levels The score data you must use for this program are as follows: Game Level Score 1 450 2 316 3 148 Stack implementations is mandatory.

0 Answers  


Design a program using one-dimensional array that determines the highest value among the eight input values from a user. Display the difference of each value from the highest to the lowest.

1 Answers   RoboSoft,


Why the program getting error if we don't use String args[] in main(), even in the case of not getting any arguments from command line?

1 Answers  


how to create a (*)pyramid using java codes???

5 Answers   Infosys,


inner join,outerjoin,trigger,stored procedure explain with code snippets?

1 Answers   IBM,


Write a java program to display multiplication table in a Frame.

1 Answers  


Categories