Draw a Time Table in Applet

Hi,
what components i need to add into my applet to create a TimeTable which the TimeTable will be changed when the information changed.
the display like ...
|____________________|______________________________|
| | |
01/01/2001 15/05/2001 01/01/2002
do anyone got the sample of this type of design ??
thank you.

Hi
Create your own TableModel and add it to the JTable. Which is used to display the Time Table, Place a timer and keep on refreshing the JTable with an interval.
Or
Use a Grid layout, place the values in the grid, keep repainting the values on a refresh timer.
Hope this helps
Thanks
Swaraj

Similar Messages

  • Help with Times Table GUI applet

    Hello,
    I need help with an applet which inputs an integer from the user and displays the appropiate times table up to times 10 eg; user input 5 - display shows
    5 time 1 is 5
    5 times 2 is 10
    5 times 10 is 50.
    I have only managedt o get the display to show one statement eg 5 times 1 - I have tried using a for loop to show the whole table - but unlike a print statement each time the loop goes round it overwrites the data in the display box with the new data - any help would be much appreciated.
    Note: it is for a programming course year 1 exercise - so I can only use basic constructs or loops to achieve this. Thanks in advance! Heres what I have so far:
    import java.applet.* ;
    import java.awt.* ;
    import java.awt.event.* ;
    public class TimesTableApplet extends Applet implements ActionListener
         // Declare the GUI components globally
         Label titleLabel, whichTableLabel ;
         TextField whichTableBox, resultBox ;
         Button showTableButton, clearButton ;
         // Declare integer variables for holdind the number input by the user,
         // the times number, and the result number
         int whichTable, times=1, result ;
         // Declare variables to hold string versions of the three integer variables
         // above, for placing in the TextFields
         String whichTableString, timesString, resultString ;
         public void init ()
              // Create the Labels
              titleLabel = new Label ( "Times Table" ) ;
              whichTableLabel = new Label ( "Which Table?" ) ;
              // Create the TextFields
              whichTableBox = new TextField ( 5 ) ;
              resultBox = new TextField ( 30 ) ;
              // Create the Buttons
              showTableButton = new Button ( "Show Table" ) ;
              clearButton = new Button ( "Clear" ) ;
              // Add the components to the applet window
              add ( titleLabel ) ;
              add ( whichTableLabel ) ;
              add ( whichTableBox ) ;
              whichTableBox.addActionListener ( this ) ;
              add ( resultBox ) ;
              resultBox.setEditable ( false ) ;
              add ( showTableButton ) ;
              showTableButton.addActionListener ( this ) ;
              add ( clearButton ) ;
              clearButton.addActionListener ( this ) ;
         } // End of init method
         public void actionPerformed ( ActionEvent event )
              // Find out which button generated the event
              String arg = event.getActionCommand () ;
              // If the user clicks the clear button, clear the whichTableBox and
              // resultBox
              if ( arg.equals ( "Clear" ) )
                   whichTableBox.setText ( "" ) ;
                   resultBox.setText ( "" ) ;
              else
                   try
                        // Try extracting a string from the whichTableBox ( the users input )
                        // and converting it to an integer
                        whichTableString = whichTableBox.getText () ;
                        whichTable = Integer.parseInt ( whichTableString ) ;
                        // Clear status box
                        showStatus ( "" ) ;
                        // If the user clicks the showTableButton, display the appropiate
                        // times table up to times 10
                        if ( arg.equals ( "Show Table" ) ) ;
                             result = whichTable * times ;
                             timesString = Integer.toString ( times ) ;
                             resultString = Integer.toString ( result ) ;
                             resultBox.setText ( whichTableString + " times " + timesString + " is " + resultString ) ;
                   } // End of try block
                   catch ( NumberFormatException entry )
                        // Display error message and clear whichTableBox
                        showStatus ( "Error: Invalid Input - not an integer!" ) ;
                        whichTableBox.setText ( "" ) ;
                   } // End of catch block
              } // End of else statement
         } // End of actionPerformed method
    } // End of class

    use this code, please arrange your User interface correctly.
    * TimesTableApplet.java
    * Created on March 12, 2007, 12:08 PM
    * @author cc.woon
    import java.applet.* ;
    import java.awt.* ;
    import java.awt.event.* ;
    public class TimesTableApplet extends Applet implements ActionListener
    // Declare the GUI components globally
    Label titleLabel, whichTableLabel ;
    TextField whichTableBox ;
    TextArea resultBox;
    Button showTableButton, clearButton ;
    // Declare integer variables for holdind the number input by the user,
    // the times number, and the result number
    int whichTable, times=1, result ;
    // Declare variables to hold string versions of the three integer variables
    // above, for placing in the TextFields
    String whichTableString, timesString, resultString ;
    public void init ()
    // Create the Labels
    titleLabel = new Label ( "Times Table" ) ;
    whichTableLabel = new Label ( "Which Table?" ) ;
    // Create the TextFields
    whichTableBox = new TextField ( 5 ) ;
    resultBox = new TextArea() ;
    // Create the Buttons
    showTableButton = new Button ( "Show Table" ) ;
    clearButton = new Button ( "Clear" ) ;
    // Add the components to the applet window
    add ( titleLabel ) ;
    add ( whichTableLabel ) ;
    add ( whichTableBox ) ;
    whichTableBox.addActionListener ( this ) ;
    add ( resultBox ) ;
    resultBox.setEditable ( false ) ;
    add ( showTableButton ) ;
    showTableButton.addActionListener ( this ) ;
    add ( clearButton ) ;
    clearButton.addActionListener ( this ) ;
    } // End of init method
    public void actionPerformed ( ActionEvent event )
    // Find out which button generated the event
    String arg = event.getActionCommand () ;
    // If the user clicks the clear button, clear the whichTableBox and
    // resultBox
    if ( arg.equals ( "Clear" ) )
    whichTableBox.setText ( "" ) ;
    resultBox.setText ( "" ) ;
    else
    try
    // Try extracting a string from the whichTableBox ( the users input )
    // and converting it to an integer
    whichTableString = whichTableBox.getText () ;
    whichTable = Integer.parseInt ( whichTableString ) ;
    // Clear status box
    showStatus ( "" ) ;
    // If the user clicks the showTableButton, display the appropiate
    // times table up to times 10
    if ( arg.equals ( "Show Table" ) ) ;
    result = whichTable * times ;
    timesString = Integer.toString ( times ) ;
    String output = "";
    for(int i =1;i<=10;i++){
    output += whichTable +" times "+i + ": "+(i*whichTable)+"\n";
    resultString = Integer.toString ( result ) ;
    //resultBox.setText ( whichTableString + " times " + timesString + " is " + resultString ) ;
    resultBox.setText ( output) ;
    } // End of try block
    catch ( NumberFormatException entry )
    // Display error message and clear whichTableBox
    showStatus ( "Error: Invalid Input - not an integer!" ) ;
    whichTableBox.setText ( "" ) ;
    } // End of catch block
    } // End of else statement
    } // End of actionPerformed method
    } // End of class

  • Help with a Times Table Applet.

    Hey,
    I am a college student and I have been given the task of constructing a times table applet. Basically, I am stuck to the point of where I have no clue of what to do next. Even my college tutor is stuck as to what to do. I was wondering if you could give me any aid in helping me develop this applet fully, so that it is correct and functioning. Here it is:
    import java.io.*;
    import Input.*;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    abstract class TimesTableApplet extends Applet implements ActionListener
         public void initialize();{}
         String message="";
         public void init()
         Button btnClick= new Button("Enter");
    add(btnClick);
              //String line = null;
              float table = 0, range = 0, attempts = 0;
              int count = 1, reply = 1, lines = 1;
    TextArea textone;
         while(reply==1)
                   String line = null;
                   table = 0;
                   range = 0;
                   ClrScr.ClrScr();
                   textone = new TextArea("",10,30+12*lines);
                   lines=1;
              while (( table < 1) || (table > 20) && attempts <3)
                   textone = new TextArea("Input table from 1-20:",10,10);
                   table = Input.readFloat();attempts++;
              attempts = 0;
                   while (( range < 1) || (range > 14) && attempts <3)
                        textone = new TextArea("Input range 1-14:,10,20");
                        range = Input.readFloat();attempts++;
              if (( table >= 1) && (table <= 20))
                   if (( range >= 1) && (range <= 14))
                   while (count<=range)
                        textone = new TextArea(count + "x" + table + "=" + count * table);
                        count++;
                        lines++;
                   count=1;
                   textone = new TextArea("Would you like another go? Type '1' for yes");
                   reply = Input.readInt();
         }//end while reply ==1
         }//end init
         public void paint(Graphics g)
         int count =1;
         while ( count <=80)
         System.out.println();
         count++;
    }

    Ok, why did you post this code? we will not be able to compile it because we are missing
    the Input package not did you mention wich jar to find this (nor did google).
    Syntax error in initialize
    Usage of the unknown object ClrScr (static method ClrScr)
    Usage of the unknown object Input (static method readFloat and readInt)
    If your tutor is stuck he or she should find a new job.
    import java.io.*;
    import Input.*;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    abstract class TimesTableApplet extends Applet implements ActionListener {
         public void initialize(){
         String message = "";
         public void init() {
              Button btnClick = new Button("Enter");
              add(btnClick);
              //String line = null;
              float table = 0, range = 0, attempts = 0;
              int count = 1, reply = 1, lines = 1;
              TextArea textone;
              while (reply == 1) {
                   String line = null;
                   table = 0;
                   range = 0;
                   ClrScr.ClrScr();
                   textone = new TextArea("", 10, 30 + 12 * lines);
                   lines = 1;
                   while ((table < 1) || (table > 20) && attempts < 3)
                        textone = new TextArea("Input table from 1-20:", 10, 10);
                        table = Input.readFloat();
                        attempts++;
                   attempts = 0;
                   while ((range < 1) || (range > 14) && attempts < 3) {
                        textone = new TextArea("Input range 1-14:,10,20");
                        range = Input.readFloat();
                        attempts++;
                   if ((table >= 1) && (table <= 20))
                        if ((range >= 1) && (range <= 14)) {
                             while (count <= range) {
                                  textone = new TextArea(count + "x" + table + "="
                                            + count * table);
                                  count++;
                                  lines++;
                   count = 1;
                   textone = new TextArea(
                             "Would you like another go? Type '1' for yes");
                   reply = Input.readInt();
              }//end while reply ==1
         }//end init
         public void paint(Graphics g) {
              int count = 1;
              while (count <= 80) {
                   System.out.println();
                   count++;
    }

  • Another times table applet attempt..

    Okay, I posted here a few days ago regarding a previous times table applet I had attempted. Well that one was, basically, going nowhere fast, so I remodelled it and came up with the following code. But the thing is that is comes up with two errors which I can't, for the life of me, figure out how to overcome it. Any suggestions would be greatly appreciated.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TimesTableApplet2 extends JApplet
    JTextArea textArea;
    public void init()
    textArea = new JTextArea();
    textArea.setEditable(false);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(new JScrollPane(textArea));
    getContentPane().add(getUIPanel(), "South");
    public JPanel getUIPanel()
    final JTextField
    range = new JTextField(2),
    table = new JTextField(2);
    JButton enter = new JButton("Calculate");
    enter.addActionListener(new ActionListener());
    public void ActionPerformed(ActionEvent e)
    String s = table.getText();
    int table = Integer.parseInt(s);
    s = range.getText();
    int range = Integer.parseInt(s);
         if (( table >= 1) && (table <= 20))
                        if (( range >= 1) && (range <= 14));
                   int count = 1;
                   int reply = 1;
                   int attempts = 0;
                   if ((( range <= 1) || (range >= 14)) && (attempts <= 3));
                   while (count<=range)
                        textArea.append(count + " x " + table + " = " + count * table);
                        count++;
              count=1;
    JPanel panel = new JPanel();
    panel.add(new JLabel("Range"));
    panel.add(range);
    panel.add(new JLabel("Table"));
    panel.add(table);
    panel.add(enter);
    return panel;
    public static void main(String[] args)
    JApplet applet = new TimesTableApplet2();
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(applet);
    f.setSize(200,200);
    f.setLocation(200,200);
    applet.init();
    f.setVisible(true);
    }

    Typos - errant semi-colons and an extra ' ) '
            enter.addActionListener(new ActionListener());
                                                        ^^
                        if (( range >= 1) && (range <= 14));
                                                          ^
                    if ((( range <= 1) || (range >= 14)) && (attempts <= 3));
                                                                           ^

  • How to draw a complex table

    It is table with 5 rows and 4 colunms and forget about height and width.
    By using only single <table> tag is it possible to draw such a table.
    I tried but felt.
    I am inserting a link for that figure just visit it .
    Please reply
    Thank you
    http://sites.google.com/site/1024768images/Home
    Edited by: pankajjain15 on Oct 22, 2008 7:20 AM [http://sites.google.com/site/1024768images/Home]
    Edited by: pankajjain15 on Oct 22, 2008 7:26 AM

    i thought that in java forum there are genius guyes are looking for some challanges in any kind of language.
    They are having some good problem solving skills and helps those who can not solve the problem
    As you wasted time to teach me some thing , you should not be such egoistic person as you know every thing.
    One more thing nobody is perfect.
    Thanks for your cooperation

  • How to lmplement table in applet

    hi friends
    im not known how to implement table in applet using " java.applet.* " class
    plz reply as soon as possible..

    friend
    my project is implemented in applet but as u suggest
    for Jtable concept then my project is workingSo you have a JTable and it works? What are you asking then?
    What is your applet built with AWT, Swing, something else?

  • Help with calculation code!! for Times tables program

    I am creating a times tables program that lets the user select the Times tables, number of lines required and the type of table (multipy, addition etc).
    So if user selects 12 times tables and 4 lines it should look like this on the screen:
    12 x 1 = 12
    12 x 2 = 24
    12 x 3 = 36
    12 x 4 = 48
    and so on...
    Problem is that when I pass the info to the procedure in the below code I am not sure what I need to do to replicate the above.
    Appreciate some ideas! Here is code so far:
    class assign2{                                                                                                         // Begin Class
         public static void main(String[]args){                                                                      // Begin Main
              int table;                                                                                                    // Declare a variable
              int lines;                                                                                                    // Declare a variable
              char type;                                                                                                    // Declare a variable
              do                                                                                                              // Begin do - while loop
                   System.out.println("Please enter the times tables required (1 - 12)");
                   Keyboard.skipLine();
                   table = Keyboard.readInt();
                   if (table < 1 || table > 12)
                   System.out.print("INVALID ENTRY - Please try again and enter between 1 and 12");    // Error msg if invalid
                   System.out.println();
            }while (table < 1 || table > 12);                                                                      // End do - while loop
            do                                                                                                              // Begin do - while loop
                 System.out.println("Please enter the number of lines required (1 - 12)");
                 Keyboard.skipLine();
                 lines = Keyboard.readInt();
                   if (lines < 1 || lines > 12)
                   System.out.print("INVALID ENTRY - Please try again and enter between 1 and 12");    // Error msg if invalid
                   System.out.println();
            }while (lines < 1 || lines > 12);                                                                      // End do - while loop
              do                                                                                                              // Begin do - while loop
                   System.out.println("Please select the table type from one of the following (A - D): ");
                   System.out.println();
                   System.out.println("A: Multiplication Tables");
                   System.out.println("B: Division Tables");
                   System.out.println("C: Addition Tables");
                   System.out.println("D: Subtraction Tables");
                   Keyboard.skipLine();
                   type = Keyboard.readChar();
                   if (type != 'a' && type != 'b' && type != 'c' && type != 'd')
                   System.out.print("INVALID ENTRY - Please try again and enter either A - B - C - D");      // Error msg if invalid
                   System.out.println();
              }while (type != 'a' && type != 'b' && type != 'c' && type != 'd');                              // End do - while loop
                   switch(type){                                                                                          // Begin Switch
                        case 'a': getMultiply(table, lines); break;
                        case 'b': getDivide(); break;
                        case 'c': getAdd(); break;
                        case 'd': getSubtract(); break;
                   }                                                                                                         // End Switch
       //Procedure to calculate the Multiplication Times Tables//
              static void getMultiply(int table, int lines){
       //Procedure to calculate the Division Times Tables//
              static void getDivide(){
                   System.out.println("This is divide!!!");
       //Procedure to calculate the Addition Times Tables//
              static void getAdd(){
                   System.out.println("This is Add!!!");
       //Procedure to calculate the Subtraction Times Tables//
              static void getSubtract(){
                   System.out.println("This is Subtract!!!");
         }                                                                                                              // Ends Main
    }                                                                                                                   // Ends Class

    I wasn't being rudeYes, you were.
    or expecting an immediate
    responseYour posts suggested otherwise.
    I was simply expressing how I was stuck with
    the problem.That's not relevant to anybody here. What is relevant is your specific question, which I don't see in your initial post. Just "how do I do this?"
    You know what, I am a beginner to this programming
    and it's people like you with your smug attitute and
    'KNOW IT ALL' behaviour that puts people like me off
    even looking to go down this road as a career.Given your attitude so far, I doubt you'll be missed.
    So, why don't you stop acting like a spoilt little
    child and stop pretending like you own this forum.Flounder was right: Nobody here likes that demanding, "Help me now!" attitude. Coupled with the fact that your question is very vague and the tone of your subsequent posts, you're not doing much to encourage anyone to volunteer their time to help you.
    Not to mention that posting the same question multiple times is rude and annoying. It's very irritating to spend time answering a question, only to find out somebody else has already answered it.

  • How to create a time table by Automator

    I want to create a new calendar by using Automator. It is a time table.
    In the time table, there are Day 1 - Day 6.
    For example,
    https://files.me.com/lawhei/442uc1
    so on.
    It starts from 1/9/2010 and end on 1/7/2011.
    h represent holiday, no event needs to be created. The date of holiday is provided by the school.
    The problem that I am facing now is I can filter out the holiday but I don't know how to pass the dates to next action. The provided iCal actions are suck. How can I write my own action? Or do you guys have any suggestions for me to create such calendar?

    I just want to check I understand your issue.
    You have 1 WebI document which has 2 objects on it. One is a table and the other is a graph of the same values.
    You are linking to the graph using openDocument. However, you want to pass values from tableA (selected row values) into the graph.
    Is this correct?
    Regards
    Alan

  • How draw image into frame in applet

    How draw image into frame in applet.Please give my simple example code.

    http://search.java.sun.com/search/java/index.jsp?qt=%2Bdraw+%2Bimage+%2Bpanel+%2Bhow&nh=10&qp=&rf=1&since=&country=&language=&charset=&variant=&col=javaforums

  • HDS Real time tables shows negetive figures

    cisco real time tables throwing  strange number(figure)  for offered calls every
    mid night between 00:00 and 00:05. (Table name Call_type_real_Time)
    Kindly note we have problem with the real time data in the CISCO database, it gives number of calls received in negative figures during early
    hours of the day .Appreciate to comment  if any one comes across the same ? Any suggesion

    our set up (version) as follows
    ICM 7.0_SR4;CTIOS7.0(0)SR2& ES13/ES25
    CCM4.1(3)SR4d
    CVP3.1(0),SR2 & ES3

  • ESS - add a new column to Record Working Time table

    Hello all,
    My client would like to add a column to the Record Working Time table in ESS. They would like to add a column for Activity Name next to Activity Number. Can anyone tell me where this can be congured? Or would this be something I would need to hard-code in the ess~cat source code?
    Thanks,
    -Kevin

    I have figured out the 2 step process needed for this, involving Modifiable and Influencing. So I am able to add new fields. The only issue I am running into now appears to be dependant on the field name.
    I can add CATSD-VORNR
    But I cant add CATSDB-LTXA1
    I have tried a few variations and it seems i can add fields from CATSD but not from CATSDB?
    Has anyone else seen this or know what steps must be taken to display CATSDB-LTXA1?
    Thanks,
    -Kevin

  • While load is going on in r3 at the time table is locked

    Hi All,
                i have some few queries.
    1. while load is going on in r3 at the time table is locked.in which sccenarion this type of problem will happens.
    2. Change run already started by aleremote.in which sccenarion this type of problem will happens.
    3.aleremote user is locked.in which sccenarion this type of problem will happens.
    Thanks & Regards,
    chandra.

    Hi All,
                i have some few queries.
    1. while load is going on in r3 at the time table is locked.in which sccenarion this type of problem will happens.
    2. Change run already started by aleremote.in which sccenarion this type of problem will happens.
    3.aleremote user is locked.in which sccenarion this type of problem will happens.
    Thanks & Regards,
    chandra.

  • Time table generation of computer science department

    hi,
    i santanu need help of the people of this forum on developing the project on generation of computer science department .
    input- the number of teacher,no of class rooms,no of classes rae specified
    output-- the time table is generated witha the help of program
    i got a largr project which is combination of 5 to 6 individual project.so please help me in solving this program.if any one got the code for it or any help will always be appreciated.
    thank you.
    santanu

    Don't crosspost please!
    http://forum.java.sun.com/thread.jspa?threadID=5148535
    http://forum.java.sun.com/thread.jspa?threadID=5148533
    http://forum.java.sun.com/thread.jspa?threadID=5148532
    For ideas, look at this thread:
    http://forum.java.sun.com/thread.jspa?threadID=636835

  • Time Table for File Vault 2 FIPS-140-2 Certification

    I believe I read something that Lion/File Vault 2 encryption was submitted to NIST for FIPS-140-2 certification.   I know that IOS 5 is first to be certified, but does anyone know the time table for Lion/File Vault 2 to be certified?     I was told a few months ago that it would be certified by 12/31/2011.   Any update would be appreciated.  

    Disclosure: I work for NIST, but not in the Computer Security Div. (the group that issues the certificates).
    Looking at the NIST list of validated modules, Lion's crypto module recieved its certification on 3/30/12, but I don't know if this applies to all apps or just the libraries.  It doesn't apply to 3rd party apps yet (note says it will be re-evaluated for that use).  I wouldn't think File Vault is a "third party" app. 
    I'll post more if I find out anything.

  • Dynamic Time Table For collage

    How To create Dynamic Time Table for collage.. plz tell me the Concept For this Question.. I need Argent

    Disclosure: I work for NIST, but not in the Computer Security Div. (the group that issues the certificates).
    Looking at the NIST list of validated modules, Lion's crypto module recieved its certification on 3/30/12, but I don't know if this applies to all apps or just the libraries.  It doesn't apply to 3rd party apps yet (note says it will be re-evaluated for that use).  I wouldn't think File Vault is a "third party" app. 
    I'll post more if I find out anything.

Maybe you are looking for

  • Movies stop then spped up to catch up with sound help me

    movie picture keep stoping then speeds up to catch up with the sound while im watching movies on itunes. help!!!!

  • Strange Facet of Imported Graphic: ò\e2

    Hello Framers, I am using Frame 7.1 and have just taken over a project from a colleague who is sometimes, er, careless with best practices. So I MIF-washed all files (replacing all OLE2 graphics) and tried to save as RTF. Frame crashed. I looked at t

  • I am having trouble simply getting into my account

    Hello I am a firsdt time user and am really frustrated. I have just replaced my iphone and am having trouble getting into my account in order to sync my phone

  • Query Regarding 2 Calls From XI to same Database.

    Hi All, I've a scenario in which XI has to call the Database two times: First call is to get a value from the Database by using stored procedure Second call is to update a table in the same Database by one to one mapping. I've called the stored proce

  • How to hide particular data on rows in ssrs reports ?

    Hi, i have requirement, in my ssrs report i have columns like sites,Accounts,LOBs and etc., i don't want to show some of the accounts in rows for some particular sites, please check the below image.here i don't want to show the ally finacial and fox