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

Program to print map of India in java.

2 Answers  


write a program in java to find the moving average of all prime numbers between 2 and 100.

0 Answers  


Write a program to convert a decimal number to binary form?

1 Answers   Oracle,


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

1 Answers  


Bubble Sort. java thereafter the user will be asked to inpout the size of the list,sort the list in ascending order and display the sorted list in a horizontal manner???

0 Answers  






write a program that inputs two real numbers then exchanges their values.

7 Answers   Infosys,


How to create Date method to set the date in Ms Access

0 Answers  


I am trying to pass the string firstName from a Servlet called SampleServet. I am running this on eclipse and it tells me that "the value for annotation attribute must be a constant expression. I don't understand why it is giving me this error. @PersonAnnotation(name = SampleServlet.firstName) public class AnnotationClass{

0 Answers  


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

1 Answers   Tech Mahindra,


Is there any static classes are in java give some examples

0 Answers  


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  


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  


Categories