HI there, need help in thinking of a logic.

Good Day!
I'm having trouble thinking of the logic in this simple (but tediously hard for me) problem.
I've got two internal tables, say table A and table B. I need to output records from table A that do not match records from table B. and vice versa.
The thing is, before I can output them, there are 3 primary keys for each table. let's say, ID, Document, and date. I need to match 3 of them to the other table, and if they don't match I would have to print them out.
What I did was.
Loop at TABLEA.
     Loop at TABLEB.
        IF TABLEA-ID NE TABLEB-ID AND ...
        WRITE TABLEA-ID ...
        ENDIF.
     ENDLOOP.
ENDLOOP.
The problem is,  let's say table a has
ID: 0
Doc:1
Date: 1
ID:1:
DOC:1
DATE:1
table b has
ID:1
DOC:1
DATE:1
and so on..
the loop will first compare table a with b and if it doesn't match well.. it prints it out immediately. Maybe the 1st record of table A is in the 20th record of table B. So I get multiple unmatches. So now I'm turning to the experts here, hope you guys can help.
I'm not sure if there was a faster way to do this. Any suggestions would be appreciated.
Edited by: Katrina Dy on Jul 2, 2008 8:56 AM

Hello
sort tablea by ID Document date.
sort tableb by ID Document date.
loop at tablea.
  read tableb with key ID = tablea-ID
                                Document = tablea-Document
                                date = tablea-date
                                binary search.
  if sy-subrc NE 0.
    write: tablea-ID, ...
  endif.
endloop.
loop at tableb.
  read tablea with key ID = tableb-ID
                                Document = tableb-Document
                                date = tableb-date
                                binary search.
  if sy-subrc NE 0.
    write: tableb-ID, ...
  endif.
endloop.

Similar Messages

  • Hi there, need help for this program...thx!

    Hi there guys,
    I have created this applet program that requires a user to login with a user no, and a password. I am using arrays as to store the defined variables,(as required by my project supervisor). My problem here is that when the arrays are declared in class validateUser(), the program would run fine, but i cant login and i get a NullPointerException error. if the arrays are located in actionPerformed, i get a 'cannot resolve symbol' error for the method 'get' and 'if (Admin.equals(admins.get(i).toString())) ' as well as 'if (Password.equals(passwordsget(i).toString())) '. I am not very effecient in java, hence the untidy program (and i have to admit, it isnt any good), so sorry for any inconvenience caused. Once agani thx in advance ;)
    here are my codings :
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.URL;
    import java.net.*;
    import javax.swing.*;
    import java.lang.*;
    import java.util.Vector;
    public class eg31662 extends Applet implements ActionListener
         Panel panel1, panel2, panel3, panel4, panel5;
         Button login, enter;
         Label inst, top, admin, pass, fieldlabel;
    TextField adminF, passF, field;
    String Admin, Password;
    Vector admins, passwords;
         Thread thread = null;
         boolean status = false;
              public class validateUser extends Applet
                   String[] admins = {"User1", "User2", "User3"};
                   String[] passwords = {"P1", "P2", "P2"};
         public void init()
              setLayout (new BorderLayout());
              panel1 = new Panel(new FlowLayout());
              panel2 = new Panel(new FlowLayout());
              //login button
              login = new Button("Login");
              //instruction
              inst = new Label("Please type in your User no. and the given password in order to proceed");
              //label
              top = new Label("Login login");
              admin = new Label("Admin No :");
              pass = new Label("Password :");
              //input textfields
              adminF = new TextField(8);
              passF = new TextField(10);
              passF.setEchoChar('*');
              panel1.setBackground(Color.gray);
              panel2.setBackground(Color.orange);
              panel2.add(admin);
              panel2.add(adminF);
              panel2.add(pass);
              panel2.add(passF);
              panel2.add(login);
              panel2.add(inst);
              panel1.add(top);
              add(panel1, BorderLayout.NORTH);
              add(panel2, BorderLayout.CENTER);
              login.addActionListener(this);
              setSize(500,400);
         void mainpage()
              boolean flag = true;
              setLayout (new BorderLayout());
              panel1 = new Panel(new FlowLayout());
              panel2 = new Panel(new FlowLayout());
              top = new Label("Welcome");
              enter = new Button("Enter");
              panel2.setBackground(Color.orange);
              panel1.setBackground(Color.gray);
              fieldlabel = new Label("Type something here :");
              field = new TextField(20);
              add(panel1, BorderLayout.NORTH);
              add(panel2, BorderLayout.CENTER);
              panel2.add(fieldlabel);
              panel2.add(field);
              enter.addActionListener(this);
         public void start() {
              if(thread == null) {
                   status = true;
         public void stop() {
              status = false;
         public void run() {
              while(status == true) {
                   try {
                        thread.sleep(50);
                   catch(InterruptedException ie) {
                   repaint();
              thread = null;
         public void actionPerformed(ActionEvent ev)
                   //String[] admins = {"User1", "User2", "User3"};
                   //String[] passwords = {"P1", "P2", "P3"};
              if(ev.getSource() == login)
                   Admin = adminF.getText();
                   Password = passF.getText();
              boolean ok = true;
              for (int i = 0; i < admins.size(); i++) {
              if (Admin.equals(admins.get(i).toString())) {
              if (Password.equals(passwords.get(i).toString())) {
              ok = true;
              this.setVisible(false);
              //break;
                             JOptionPane.showMessageDialog(null, "Welcome, u have successfully logged in");
                             mainpage();
              else {
              ok = false;
              else {
              ok = false;
              if (ok == false) {
                             JOptionPane.showMessageDialog(null,
                        "Incorrect Password or Admin No, Please Try Again",
                        "Access Denied",
                        JOptionPane.ERROR_MESSAGE);
              else {
              this.setVisible(false);
    }

    Hi, sorry to bring this thread up again, but this is actually a continuation from my previous posted program. Hope u guys can help me again!
    Right now i'm supposed to come up with a simple quiz program, which consists of the center panel displayin the question (in a pic format), and a textfield to enter the answer at the lower panel. this goes on for a couple of pages and once it is completed, the final page would display the total correct answers out of the number of questions, as well as the score in percentage form.
    The few(or many) problems taht i'm facing are :
    1)How do i save the answers that are typed in each textfieldAnd later on checked for the correct answer based on the array given?
    2)How do i go about doing the final score in percentage form and total of correct answers?
    3)I previously tried out using canvas, but it didnt seem to work. my questions(pictures) that are supposed to displayed in the center(canvas) produce nothing. How do i rectify that?
    i'm really sorry for the mess in the codings, hope this wouldnt be a hassle for any of u out there. Once again thanks in advance!
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.URL;
    import java.net.*;
    import java.util.Vector;
    import javax.swing.*;
    import java.awt.image.*;
    import java.lang.*;
    import java.awt.Graphics;
    public class eg31662 extends Applet implements ActionListener
        Panel panel1, panel2, panel3, panel4, panel5;
        Button login, enter;
        Label inst, top, admin, pass, startLabel;
        TextField adminF, passF, field;
        String Admin, Password;
        Vector admins, passwords;
         //Quiz declarations
         TextField ansF1,ansF2,ansF3;
         Button startBut, next0, next1, finishB, previous1;
         Image q1, q2, q3;
         Image ques[] = new Image[2];
         boolean text = false;
         boolean checked = false;
         int correct = 0;
         String [] answer = new String [2];
         String [] solution = {"11", "22", "33"};
         boolean text = false;
         boolean sound = true;
         int red,green,blue;
         int question =0;
         int good = 0;
         boolean pause= false;
         boolean start = true;*/
        Thread thread = null;
        boolean status = false;
        public void init()
            validateUser();
            setLayout (new BorderLayout());
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            //login button
            login = new Button("Login");
            //instruction
            inst = new Label("Please type in your UserName and the given " +
                             "password in order to proceed");
            //label
            top = new Label("Top Label");
            admin = new Label("User Name :");
            pass = new Label("Password :");
            //input textfields
            adminF = new TextField(8);
            passF = new TextField(10);
            passF.setEchoChar('*');
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
              panel3.setBackground(Color.gray);
            panel2.add(admin);
            panel2.add(adminF);
            panel2.add(pass);
            panel2.add(passF);
            panel2.add(login);
            panel3.add(inst);
            panel1.add(top);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
            login.addActionListener(this);
            setSize(500,400);
        private void validateUser()
            String[] adminData    = {"t", "User1", "User2", "User3"};
            String[] passwordData = {"t", "P1", "P2", "P3"};
            admins = new Vector();
            passwords = new Vector();
            for(int j = 0; j < adminData.length; j++)
                admins.add(adminData[j]);
                passwords.add(passwordData[j]);
        private void Mainpage()
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
              panel3 = new Panel(new FlowLayout());
            top = new Label("Welcome");
            enter = new Button("Enter");
            panel2.setBackground(Color.orange);
            panel1.setBackground(Color.gray);
            panel3.setBackground(Color.gray);
            startLabel = new Label("Welcome! " +
                                          "Please click on the 'Start' button to begin the quiz ");
              startBut = new Button("Start");
              startBut.requestFocus();
              Dimension dim = getSize();
              startBut.setSize(50,20);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
            panel2.add(startLabel);
            panel2.add(startBut);
            startBut.addActionListener(this);
            validate();
            repaint();
        private void Quiz1()
              //quizCanvas = new Canvas();
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q1 = getImage(getDocumentBase(), "1.gif");
              ques[0] = q1;
              //ques[1] = q2;
              //previous = new Button("<");
              next0 = new Button("Done");
            ansF1 = new TextField(25);
              next0.addActionListener(this);
              //quizCanvas.insert(ques1);
            //panel3.add(previous);
            panel3.add(next0);
            panel3.add(ansF1);
            //panel2.add("1.gif");
              ansF1.requestFocus();
              ansF1.setText("focussing");
            validate();
            repaint();
         public void Quiz2(){
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q2 = getImage(getDocumentBase(), "2.gif");
              ques[1] = q2;
              next1 = new Button("Done");
            ansF2 = new TextField(25);
              next1.addActionListener(this);
            panel3.add(next1);
            panel3.add(ansF2);
              ansF2.requestFocus();
              ansF2.setText("focussing");
            validate();
            repaint();
         public void Quiz3(){
            boolean flag = true;
            removeAll();  // remove all components from container
            panel1 = new Panel(new FlowLayout());
            panel2 = new Panel(new FlowLayout());
            panel3 = new Panel(new FlowLayout());
            panel1.setBackground(Color.gray);
            panel2.setBackground(Color.orange);
            panel3.setBackground(Color.gray);
            add(panel1, BorderLayout.NORTH);
            add(panel2, BorderLayout.CENTER);
            add(panel3, BorderLayout.SOUTH);
              q3 = getImage(getDocumentBase(), "3.gif");
              ques[2] = q3;
              finishB = new Button("Finish");
            ansF3 = new TextField(25);
              finishB.addActionListener(this);
            panel3.add(finishB);
            panel3.add(ansF3);
              ansF3.requestFocus();
              ansF3.setText("focussing");
            validate();
            repaint();
        public void start() {
            if(thread == null) {
                status = true;
        public void stop() {
            status = false;
        public void actionPerformed(ActionEvent ev)
            boolean ok = true;
            if(ev.getSource() == login)
                Admin = adminF.getText();
                Password = passF.getText();
                for (int i = 0; i < admins.size(); i++) {
                    if (Admin.equals(admins.get(i).toString())) {
                        if (Password.equals(passwords.get(i).toString())) {
                            ok = true;
                            JOptionPane.showMessageDialog(null,
                                        "Welcome, u have successfully logged in");
                            Mainpage();
                            break;
                        else {
                            ok = false;
                    else {
                        ok = false;
                if (!ok) {
                    JOptionPane.showMessageDialog(null,
                                  "Incorrect Password or Admin No, Please Try Again",
                                  "Access Denied",
                                   JOptionPane.ERROR_MESSAGE);
            if(ev.getSource() == startBut)
                   Quiz1();
              if (ev.getSource () == next0) {
                   saveanswer();
                   Quiz2();
              if (ev.getSource () == next1) {
                   //saveanswer();
                   Quiz3();
              if (ev.getSource () == finishB) {
                   //saveanswer();
                   //checkanswer();
         /*class quizCanvas extends Canvas {
              private Image quest;
              public quizCanvas() {
                   this.quest = null;
              public quizCanvas(Image quest) {
                   this.quest = quest;
              public void insert(Image quest) {
                   this.quest=quest;
                   repaint();
              public void paint(Graphics g) {
         public void checkanswer() {
              if (!checked) {
              /*question = 0;
                   for (int a=1;a<16;a++) {
                        question++;*/
                        if (ansF1) {
                             if (answer[1].toUpperCase().equals(solution[1])) {
                                  correct++;
                        if (ansF2) {
                             if (answer[2].toUpperCase().equals(solution[2])) {
                                  correct++;
                        if (ansF3) {
                             if (answer[3].toUpperCase().equals(solution[3])) {
                                  correct++;
              checked = true;     }
         public void saveanswer() {
              if (text) {
                   if (!ansF1.getText().equals("")) {
                        answer [Quiz1] = ansF1.getText();
                   //answer2[question] = tf2.getText();
                   if (!ansF2.getText().equals("")) {
                        answer [] = ansF2.getText();
                   if (!ansF3.getText().equals("")) {
                        answer [] = ansF3.getText();
    }

  • Needs help - i think it is my router

    I cannot log onto certain sites while I am connected to my wireless router. How can I fix this problem? I have a WRT54GS.
    Any help or advice would be greatly appreciated.

    When your computer is Hardwired to the Router are you able to access all the websites. You need to open port no. 443 on your linksys router. Open an Internet Explorer browser page.In the address bar type - 192.168.1.1 Leave the username blank & in password use admin in lower case...
    Click on the "Application and Gaming" tab and below you need to click on "Port Triggering" tab and below in Application name type "Https" and in Start and End Port Type  443 and check Box Enable and click on save settings. And after this try accessing that websites.Hope this will solve your problem.

  • I am in need help.i think my ipod is dead :-(

    i really think its dead you know, it has frozen 3times in its 13months of life but i let the battery die and hey presto all is fine....but a month ago it stopped for no reason tried loadsa stuff suggested but to no avail, eventually updated it on a friends pc and it was gr8 soooooooo overjoyed cos for 3weeks i was musically deprived, then 2 days l8r its gone again-thats tonight (12.18 in ireland now u c). i dont kno wat to do my warranty has run out...........
    ipod with photos   Windows XP  

    I HIT IT OFF A WALL...now it works

  • Skateboard videoagrapher, any out there, need help

    I'm looking for a skate video guy that can answer some questions, any out there?

    Do a time lapse of a whole group painting a graffiti of JOEY BONDI on a brick wall. Intercut it with POV footage.
    Duct tape the camera to Joey's Helmet, and intercut that with the Graffiti. At the end of the sequence have your son take the helmet off, turn it around, and Mug for the camera, maybe even introduce himself.
    Do green screen of the letters of the name written with different colored sharpies (not Green!) on cardboard or newpaper or the pages of a skate magazine. Crumple up the letters gradually. Run the result backward a 1000% (or more) so the letters reveal from the crumpled paper. Chroma key these letters over the POV footage of your camera smashing into the wall at the bottom of the hill to signal the end of the title sequence.
    Or just fire up LiveType and Motion, and play with textures and fonts and effects and filters. Listen to the music you will be cutting to while you work in the graphics applications.
    Best of luck and have fun.
    Tom

  • Need Help - I think my zen microphoto 8gb may be seriously screw

    It froze whilst playing a song and NO buttons work, it can only be turned off by removing the battery.
    However, when i turn it back on it Re-builds library, and returns to being totally frozen at the beginning of the same song.
    Any advice?
    Thanks in advance.
    teddy

    Hi,
    Have you tried putting the player in it's recovery model and perform a clean up, reboot?

  • Need help in OBIEE BMM layer logic implementation

    Hi All,
    I have a requirement in my RPD development.
    I have two tables account and site.
    Table_Name:*Account*
    Column_Name:                    
    AccountID     Store_Name     Site Data_1_Name     Site_Data_2_Name     Site_Data_3_Name
    264364     Wegmans_ Food_Markets     GSF     Floor_Type     BSC
    999999     Walmart     Floor_Type     BSC     
    999998     Walgreens     BSC     Avg_Cust_Count     GSF
    Table_Name:*Site*                                   
    Column_Name:
    Site_ID     Store_Name     Account_ID     Account_Name     Site_Name     Site Data_1_Value     Site Data_2_Value     Site Data_3_Value
    264367     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#82     96114     Vinyl     Kellermeyer
    264368     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#83     96109     Poly_Vinly     ABC
    123     Walmart     999999     Walmart     Alberta_Drive#1000     Vinly     XYZ     
    1678     Walgreens     999998     Walgreens     Calgary_ Drive#9009     ABC     10000     56565
    Site Logical/ Presentation Table in OBIEE
    Site_ID     Store_Name     Account_ID     Account_Name     Site_Name GSF     Floor_Type     BSC
    264367     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#82     96114     Vinyl     Kellermeyer
    264368     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#83     96109     Poly Vinly     ABC
    123     Walmart     999999     Walmart     Alberta_Drive#1000          Vinly     XYZ
    1678     Walgreens     999998     Walgreens     Calgary_ Drive#9009     56565          ABC
    for account table we have the Site Data_1_Name ..Site Data_3_Name columns values which is the column name for the values in Site table(i.e the values in the columns "Site Data_1_Value..Site Data_1_Value") . this values change dynamically based on the column name(Site Data_1_Name ..Site Data_3_Name ) in Account Table . how do i map this column values in RPD level ? or do we have any logic to implement this. PLEASE HELP ME TO SOLVE THIS ...
    Thanks in advance ,
    Mohan Mano

    HI mohan the information you provided holding some sensitive data please delete some of them otherwise you might be in trouble.
    Make join between the account_ID and the SITE_ID based on the inner join columns which match in both tables will retrieved in the report. If you want to see the null values as well you can use outer join.
    Thanks,
    chak

  • NEED HELP!!!!  Logical Standby and RMAN.

    Hello,
    I have a Data Guard env setup on win 2000 with 9.2.0.4.
    I now have primary and standby. I was wondering if I create a logical standby to achieve transparent application failover. What I am saying is if the primary node dies, then in tnsnames I want to point to the logical standby, since it is an open database, the users can still perform without knowing the db went down. Then if we indeed need a failover we can failover to the physical standby. This would ensure availability without having to implement RAC or AQ, Right? Also, I read that you should create rman schema (recovery catalog) on standby db. Any thoughts?

    Were you able to figure this one out?
    I have a similar configuration as you - the same motherboard and an eVga Geforce 3 6600 fanless.  With the latest BIOS (3.8) and this video card, the system will not go into Standby completely.  I hear the HDD head park and the video goes black, but the LEDs on the front of the PC chassis and the case/PS fans do not stop.  Pressing the button to bring the PC out of Standby, rather, whatever state it is in, works.

  • Need Help regarding separate GUI and logic class

    Hi,
    I was given this assignment and I'm stuck big time.
    Basically I have a GUI class for a stopwatch interface.
    public class WatchGui implements Gui{
        JButton b1, b2;
        JLabel minutes, symbol1, seconds, symbol2, hundredths;
        StopWatch stopwatch;
        public WatchGui(){
             stopwatch = new StopWatch();
             b1 = new JButton("RUN");
            minutes = new JLabel("00");
            ActionListener al = new MyActionListener(stopwatch);
            b1.addActionListener(al);
        //  Called to connect a watch to the GUI
        public void connect(Watch w) {
        public void setDisplay(String mm) {
             minutes.setText(mm);
        public void addComponentsToPane(Container pane) {
            pane.setLayout(null);
            pane.add(b1);
            pane.add(b2);
            pane.add(minutes);
            Insets insets = pane.getInsets();
        public void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("XXX");
            frame.setResizable(false);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Set up the content pane.
            WatchGui Pane = new WatchGui();
            Pane.addComponentsToPane(frame.getContentPane());
            //Size and display the window.
            Insets insets = frame.getInsets();
            frame.setVisible(true);
    }I have a watch class which function as the engine for the stop watch
    import java.awt.event.*;
    import javax.swing.*;
    class StopWatch implements Watch {
         WatchGui watchgui;
         public StopWatch() {
              running = false;
              count = 0;
        public void connect(Gui g) {
             watchgui = (WatchGui) g;
             watchgui.createAndShowGUI();
        public void runStop() {
             mm = String.valueOf("100");
         watchgui.setDisplay(mm);
    class MyActionListener implements ActionListener {
         StopWatch stopwatch;
         public MyActionListener(StopWatch stopwatch) {
              this.stopwatch = stopwatch;
         public void actionPerformed (ActionEvent e) {
              stopwatch.runStop();
    }To get the StopWatch to work, I have this driver class
    import java.lang.reflect.Constructor;
    public class Driver
        public static void main(String[] args)
          throws Exception
         if( args.length!=1 ){
             System.err.println("Usage: Driver WATCHNAME");
             System.exit(1);
             return;
         String watchName= args[0];
         Class cl= Class.forName(watchName,true,Thread.currentThread().getContextClassLoader());
         Constructor c[]= cl.getConstructors();
         if( c.length==0 ){
             System.err.println("There is NO constructor in your watch class");
             System.exit(1);
             return;
         if( c.length>1 ){
             System.err.println( "There is more than one constructor in your class");
             System.exit(1);
         //Construct the components
         Watch w=(Watch)c[0].newInstance(new Object[0]);
         Gui g= new WatchGui();
         //Connect them to each other
         g.connect(w);
         w.connect(g);
         //Reset the components()
         g.reset();
         w.reset();
         //And away we go...
         try{
             for(;;){
              Thread.sleep(10); //milliseconds
              w.tick();
         }catch(InterruptedException ie){
             System.exit(1);
    }My currently problem is that when i click on the button in the GUI, it will go to MyActionListener class and call the runStop method.
    public void runStop() {
         mm = String.valueOf("100");
         watchgui.setDisplay(mm);
    The problem is that when watchgui.setDisplay(mm) is called, exception is thrown instead. I'm suspecting it has something to do with the initialization of watchgui. Can anyone advice?

    import java.awt.*;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class WatchGui implements Gui{
         JButton b1, b2;
        JLabel minutes, symbol1, seconds, symbol2, hundredths;
        StopWatch stopwatch;
        public WatchGui(){
             stopwatch = new StopWatch();
             b1 = new JButton("RUN/STOP");
            b2 = new JButton("  RESET  ");
            minutes = new JLabel("00");
            symbol1 = new JLabel(":");
            seconds = new JLabel("00");
            symbol2 = new JLabel(".");
            hundredths = new JLabel("00");
            minutes.setFont(new Font("Arial", Font.BOLD, 40));
            symbol1.setFont(new Font("Arial", Font.BOLD, 40));
            seconds.setFont(new Font("Arial", Font.BOLD, 40));
            symbol2.setFont(new Font("Arial", Font.BOLD, 20));
            hundredths.setFont(new Font("Arial", Font.BOLD, 20));
            ActionListener al = new MyActionListener(stopwatch);
            b1.addActionListener(al);
        //  Called to connect a watch to the GUI
        public void connect(Watch w) {
        //Called to reset the GUI
        public void reset() {
             minutes.setText("00");
             seconds.setText("00");
             hundredths.setText("00");
        //Called whenever the value displayed by the watch changes
        public void setDisplay(String mm, String ss, String hh) {
             minutes.setText(mm);
             seconds.setText(ss);
             hundredths.setText(hh);
        public void addComponentsToPane(Container pane) {
            pane.setLayout(null);
            pane.add(b1);
            pane.add(b2);
            pane.add(minutes);
            pane.add(symbol1);
            pane.add(seconds);
            pane.add(symbol2);
            pane.add(hundredths);
            Insets insets = pane.getInsets();
            Dimension size = b1.getPreferredSize();
            b1.setBounds(50 + insets.left, 20 + insets.top,
                         size.width, size.height);
            size = b2.getPreferredSize();
            b2.setBounds(150 + insets.left, 20 + insets.top,
                         size.width, size.height);
            size = minutes.getPreferredSize();
            minutes.setBounds(75 + insets.left, 70 + insets.top,
                    size.width, size.height);
            size = symbol1.getPreferredSize();
            symbol1.setBounds(120 + insets.left, 70 + insets.top,
                    size.width, size.height);
            size = seconds.getPreferredSize();
            seconds.setBounds(135 + insets.left, 70 + insets.top,
                    size.width, size.height);
            size = symbol2.getPreferredSize();
            symbol2.setBounds(182 + insets.left, 87 + insets.top,
                    size.width, size.height);
            size = hundredths.getPreferredSize();
            hundredths.setBounds(190 + insets.left, 87 + insets.top,
                    size.width, size.height);
        public void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("StopWatch");
            frame.setResizable(false);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Set up the content pane.
            WatchGui Pane = new WatchGui();
            Pane.addComponentsToPane(frame.getContentPane());
            //Size and display the window.
            Insets insets = frame.getInsets();
            frame.setSize(300 + insets.left + insets.right,
                          150 + insets.top + insets.bottom);
            frame.setVisible(true);
    import java.awt.event.*;
    import javax.swing.*;
    class StopWatch implements Watch {
         WatchGui watchgui;
         long startTime;
         boolean running;
         javax.swing.Timer timer;
         String mm, ss, hh;
         int count, tmp;
         public StopWatch() {
              running = false;
              count = 0;
              timer = new javax.swing.Timer(1000, new ActionListener()
                   public void actionPerformed(ActionEvent e)
                         count++;
                         mm = String.valueOf(count);
                         ss = String.valueOf(count);
                         hh = String.valueOf(count);
                         watchgui.setDisplay(mm, ss, hh);
        //Called to connect the GUI to watch
        public void connect(Gui g) {
             watchgui = (WatchGui) g;
             watchgui.createAndShowGUI();
              //watchgui.setDisplay(mm, ss, hh);
        //Called to initialise the watch
        public void reset() {
             watchgui.reset();
        //Called to deliver a TICK to the watch
        public void tick() {
        //Called whenever the run/stop button is pressed
        public void runStop() {
             int a = 33;
             mm = "" + a;
              ss = "" + a;
              hh = "" + a;
              watchgui.setDisplay(mm, ss, hh);
             if (running == false) {
                  count = 0;
                  timer.start();
                  running = true;
             }else {
                  timer.stop();
                  running = false;
        //Called whenever the lap/reset button is pressed
        public void lapReset() {}
    class MyActionListener implements ActionListener {
         StopWatch stopwatch;
         public MyActionListener(StopWatch stopwatch) {
              this.stopwatch = stopwatch;
         public void actionPerformed (ActionEvent e) {
              stopwatch.runStop();
    import java.lang.reflect.Constructor;
    public class Driver
        public static void main(String[] args)
          throws Exception
         if( args.length!=1 ){
             System.err.println("Usage: Driver WATCHNAME");
             System.exit(1);
             return;
         String watchName= args[0];
         Class cl= Class.forName(watchName,true,Thread.currentThread().getContextClassLoader());
         Constructor c[]= cl.getConstructors();
         if( c.length==0 ){
             System.err.println("There is NO constructor in your watch class");
             System.exit(1);
             return;
         if( c.length>1 ){
             System.err.println( "There is more than one constructor in your class");
             System.exit(1);
         //Construct the components
         Watch w=(Watch)c[0].newInstance(new Object[0]);
         Gui g= new WatchGui();
         //Connect them to each other
         g.connect(w);
         w.connect(g);
         //Reset the components()
         g.reset();
         w.reset();
         //And away we go...
         try{
             for(;;){
              Thread.sleep(10); //milliseconds
              w.tick();
         }catch(InterruptedException ie){
             System.exit(1);
    public interface Gui
        //Called to connect a watch to the GUI
        public void connect(Watch w);
        //Called to reset the GUI
        public void reset();
        //Called whenever the value displayed by the watch changes
        public void setDisplay(String mm, String ss, String hh);
    interface Watch
        //Called to connect the GUI to watch
        public void connect(Gui g);
        //Called to initialise the watch
        public void reset();
        //Called to deliver a TICK to the watch
        public void tick();
        //Called whenever the run/stop button is pressed
        public void runStop();
        //Called whenever the lap/reset button is pressed
        public void lapReset();
    }

  • Need help in correlated sub query logic

    Hi ,
    I have one procedure with cursor. I have given small part of the cursor as shown below .
    SELECT
      A.DAY_DATE,
      A.COUNTRY_CODE,
      A.INST_CODE,
      a.bra_code,
      a.cus_num,
      a.cur_code,
      a.led_code,
      a.sub_acct_code,
      (tra_amt * SPOT_RATE) pre_day_crnt_bal,
      t.mat_date,
      t.NEW_INT_RATE int_rate,
      t.DEB_CRE_IND int_chg_pai_ind,
      a.ACCT_TYPE,
      (SELECT COUNT (
      DISTINCT TO_CHAR (day_date, 'mm')
      FROM PIO_TIMES
      WHERE day_date BETWEEN a.day_date
      AND NVL ( T.MAT_DATE,A.DAY_DATE) 
      AND TO_CHAR (day_date, 'dd') = '31') Test
    Here how can I build the logic for inside select statement.
    I tried to build the separate stream for the inside select statement but I am confusing how to handle the count in the inside the query.
    Please help me how to build the logic for the inside query statement .
    Thanks & Regards,
    Ramana.

    Hi Balakrishna,
    Thanks for your support
    I have applied but I am not getting the column in the output columns from the custom sql function.
    As per the procedure we are using the all conditions like between and month or date conditions  to find the count of distinct months.
    If we use partial conditional in the custom SQL  and partial conditionals in the lookup condition clause is it give the same result?
    How can we get the field of custom sql in the output field.
    Thanks & Regards,
    Ramana.

  • Need help in laoding flat file data, which has \r at the end of a string

    Hi There,
    Need help in loading flat file data, which has \r at the end of a string.
    I have a flat file with three columns. In the data, at the end of second column it has \r. So because of this the control is going to the beginning of next line. And the rest of the line is loading into the next line.
    Can someone pls help me to remove escape character \r from the data?
    thanks,
    rag

    Have you looked into the sed linux command? here are some details:
    When working with txt files or with the shell in general it is sometimes necessary to replace certain chars in existing files. In that cases sed can come in handy:
    1     sed -i 's/foo/bar/g' FILENAME
    The -i option makes sure that the changes are saved in the new file – in case you are not sure that sed will work as you expect it you should use it without the option but provide an output filename. The s is for search, the foo is the pattern you are searching the file for, bar is the replacement string and the g flag makes sure that all hits on each line are replaced, not just the first one.
    If you have to replace special characters like a dot or a comma, they have to be entered with a backslash to make clear that you mean the chars, not some control command:
    1     sed -i 's/./,/g' *txt
    Sed should be available on every standard installation of any distribution. At lesat on Fedora it is even required by core system parts like udev.
    If this helps, mark as correct or helpful.

  • Need help on menu list logic

    Thanks in advance!
    I need help on a menu list logic.
    There's this main menu which has 6 list buttons, and second
    list with 4 buttons.
    When I press on one button, it should load the next list.
    Problem I have here is when I click on the one button, it
    clears the previous main list buttons (which is what I want). On
    the second list, it only shows the last button, aka 4th button.
    I've attached my code here below, which is in the first
    frame.

    After posting this the solution hit me.
    I had to pass the parameter for the createButton as a "_root"
    instead of "this"

  • Hi need help..very urgent..

    Hi ABAPers,
    I am very new to ABAP..i need help in coding this following logic,,,
    Can anyone help me in coding this following logic..
    Step 1.  Retrieve customer number KUNNR from VBAK
    Step 2.  Pass customer number KUNNR to KNA1 and retrieve address number-ADANR value
    Step 3.  Pass ADANR value to ADRC table to retrieve NAME3
    Please do reply guys..
    full marks would be given for the right answer.
    Regards
    Sahil

    If Windows Live Mail can export the mailboxes in .mbox format then they can be imported into Mail. Otherwise, you would need to export the accounts to Thunderbird, Netscape, or Office Entourage in order to directly import into Mail.

  • I need help contacting someone that can help me find who the previous owner was who set up my iphone 5s, there is an activation lock and i need to contact the owners. help??? i think the iphone was stolen and then sold to me

    i think my iphone was stolen before being sold to me, i need help finding out who the original owner was to unlock the phone. any ideas on numbers i could ring? im super gutted

    If you are trying to activate an iPad or iPhone and it is asking for a previous owners Apple ID and password, you have encountered the Activation Lock. This is a security feature that prevents thieves from setting up and using a stolen or lost iPad or iPhone. You have no alternative. You must contact the previous owner to get permission to use the device. If you cannot contact the previous owner return the device to where you bought it and get a refund. You will never be able to activate the device and no one can help you do it.

  • Hi I am receiving thousands, yes thousands of eMails from APPLE Support Communities, In My inBox there is more than 26.000 eMails from these communities, and i Need Help from you, i will appreciate.I am not panicking but i've ever seen this !

    Apple Support Communities
    HI
    I am receiving THOUSANDS, YES THOUSANDS of eMails from ALL Apple Support Communities.I deleted some one thousand but still more than Normal.
    Please i need your Help.This is Enormous!!! I've never seen this happening! It should be a huge mistake that everybody from All Apple Support Communities
    sending me their complains? I think it is a big Mistake, or Something bigger, i don't Know! I just need Help in this moment. it's been more than three or four days
    i saw a number of eMails from Apple Support communities landing in my eMail address, should this be normal? I don't think so.
    I appreciate any Help
    Kind Regards
    & a Happy New Year

    Click Your Stuff in the upper right and select Profile. In your profile there is a link to the right to manage email notifications.

Maybe you are looking for

  • More fun with templates

    Okay, so I'm trying to modify a region template and I can't get it to work. I've tried using custom CSS in my HTML Header, I've tried actually adding a line to the CSS include file on the server - I can't get anything to work. Firebug shows that as s

  • Can I choose which iWork documents to store on iCloud?

    Hi, I was wondering if I can choose which iWork documents to store on iCloud? I have a lot of iWork files on my work Mac but I don't want them all on iCloud, just a couple that I'm currently working on, so that I can easily access and edit them when

  • Dovecot smtp won't die!

    I have a 2011 Mac mini, 8GB ram, default 10.7.4 server install. Filesharing, OD (replica) and most things work fine. Recently i've set my sights on getting non-spammy logs, and as such i've started to try to resolve every repeating log message. Today

  • Back to my mac isn't working properly

    After downloading Mavericks, (which went without a hitch), I am now receiving an error in system preferences stating: Back to my Mac isn't working properly because the DNS server isn't responding. Contact your internet service provider for a differen

  • Display Blob content in HTML Region

    Hello, I'm trying to display the contents of an .htm file in an html region. I can get it to display as a link but I can't get it to display as an image. I have a page item that is display as text (do not save state). For the source value I use a PL/