Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Faisal Ansari
Table
2 Answer(s)      3 years and 11 months ago
Posted in : Java Beginners


Why u dont understand sir?? I want to make a table program which generate a table on showMessageDialog. I have learnt these methods until now. import.javax.swiing JOptionpane Integer.parseInt() public static void main(String arg[]). I want to make program which use these above methods. No other methods to be used. Write a table program which use only and only these above methods. No Buffer,append, BufferString() methods use. pl understand my problem sir.


Advertisement
View Answers

January 31, 2011 at 4:30 PM


Hi Friend,

Check it:

import javax.swing.*;
import java.io.*;
class CreateTable{
    public static void main(String[] args)throws Exception{
       BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
      System.out.println("Enter number: ");
      int n=Integer.parseInt(br.readLine());
      String st="";
      int result;
      for(int a = 1; a <= 10; a++){
      result = n * a;
      st+=n+" * "+a+" = "+result+"\n";
      }
      JOptionPane.showMessageDialog(null,st);
     }
}

Thanks



January 31, 2011 at 4:32 PM


Hi,

If you do not want to input number from user then try this:

import javax.swing.*;
class CreateTable{
    public static void main(String[] args)throws Exception{
      String st="";
      int n=5;
      int result;
      for(int a = 1; a <= 10; a++){
      result = n * a;
      st+=n+" * "+a+" = "+result+"\n";
      }
      JOptionPane.showMessageDialog(null,st);
     }
}

Thanks



Related Tutorials/Questions & Answers:
table
table  multiplicatyion table
TABLE
TABLE   Why doesn't <TABLE WIDTH="100%"> use the full browser width
Advertisements
Table
Table  How i generate table in showMessageDialog. I want that i creat a table and run in showMessageDialogeprint("cprint("code sample");ode sample
Table
Table  How i generate table in showMessageDialog. I want to creat a table and run in showMessageDialoge. Pl make a table programe which run..., JOptionpane, Integer.parseInt. Please use only these above methods to make table
Table
Table  How I generate table in showMessageDialog. E.g 3X1=3 3X2=6 3X3=9print("code sample
Table
Table  How i generate table in JOptionpane.showMessageDialog... advance coding but i want u make the table using JOptionpane.showMessageDialog, import.javax.swing int Integer.parseInt(). Thats my limit. Pl generata a table
table
table  Hi..I have a list of links which links to a table in the same page.If I click first link the table is displayed at the top, likewise if i click the last link the table is displayed at the last,i dont know how to set
table
input from oracle table(my database table..) This is a very important table of my
table?
table?  Hi, how could i make a table in javascript, which would look like this: AA CODON Number /1000 Fraction .. (this row... can't figure out, how to construct a table,with two fixed columns, one that reads
Table
Table  Why u dont understand sir?? I want to make a table program which generate a table on showMessageDialog. I have learnt these methods until now... methods to be used. Write a table program which use only and only these above methods
Table
Table  How i create table on showMessageDialog using JOptionpane and Integer.parseInt. No other method to use. Pl make a program which generate 5X1=5 5X2=10 5X3=15   Hi Friend, Try this: import javax.swing.*; import
table in java
table in java  please l want to make table and insert by user
HEAP table
HEAP table  hiii, What is HEAP table?   hello, This type of table is stored in the memory. Speed of execution of this table is very commendable
table header
table header  how set the header to the TableModel
center a table
center a table  How do I center a table
table in java
table in java  Could any one make compiler in java please reply me
table in java
table in java  Could any one make compiler in java please reply me
table in java
table in java  Could any one make compiler in java please reply me
Multiplication table
Design and develop Multiplication table in Net beans  Design and develop a program that will print a multiplication table. The program should: Ask... table.   import java.util.Scanner; class Multiplication { public static
SQLite Table
SQLite Table  how to create a table in sqlite xcode with a fix number of items
Hash table
Hash table  Hi guys.. I have question about hash table How to implement a hash table of English words? with these methods ï??· A method put(s), which adds the string s to the table, if it is not already there (a bit
multipications table
.. Table (decide if this is HTML or JSP) Table shows the multipications table up... will be: 1 2 3 2 4 6 3 6 9 Also, add a button to Table so that pressing this button will make the table disappear. helppppp don't know were to begin plea
Multiplication table
Multiplication table Net Beans  Using Net beans Design and develop... for ending number than Display that particular multiplication table   ...(String args[]) { int n; System.out.print("Enter the number whose table
Table Creation
Table Creation  hi! I want a table which looks like following can... to make such table? plz help.........  ...","Oct","Nov","Dec" }; JTable table = new JTable(rowData, columnNames
jsf table
a table named as customer. customer table has following columns : customerid(varchar... table in this index.jsp file.this jsf file should be able to retrieve the data from... the table customer.   Hello Friend, Please visit the following link
Table Creation
Table Creation  create the table for the following fields.its very urgent for me.plz help me S.No,Category( From the home page),Name of the Candidate( After registering and after selecting the category),Age,Title of the project
Multiplication table
number than Display that particular multiplication table   import...[]) { int n; System.out.print("Enter the number whose table is to be displayed
Drop Table
Drop Table       Drop Table in SQL get rid of an object or table from the database. Using a drop Query get rid of all the rows deleted from the table and the structure is removed
Adding a flex table in another flex table column
Adding a flex table in another flex table column  how to add a flex table in another flex table column
how to use stringtokenizer on table? and display in table format.
display result in row format  how to use stringtokenizer on table? and display in table format
mysql select into table from another table example
mysql select into table from another table example  Can you suggest the correct example of select into table from another table example in MySQL... from one table into another table. Check the example at MySQLselect into new
 

 

 

DMCA.com