Package Messages

Examples of Messages.OKMessage


    private boolean Validate()
    {

        if((cpcCard.getPurpose()==null)||(cpcCard.getPurpose().trim().length()==0))
        {
            OKMessage okm=new OKMessage(mwcHost, "The field reason is obligatory!");
            okm.setVisible(true);
            okm=null;
            return false;
        }
        if(cpcCard.getAmount().trim().length()==0)
        {
            OKMessage okm=new OKMessage(mwcHost, "The field amount is obligatory!");
            okm.setVisible(true);
            okm=null;
            return false;
        }
        try
        {
            Double.parseDouble(cpcCard.getAmount().trim().replace(',', '.'));
            DateTool.getDate(cpcCard.getDate());
            return true;
        }
        catch(NumberFormatException ex)
        {
            OKMessage okm=new OKMessage(mwcHost, "<html>The field amount contains invalid caracter(s), it should be in ###.## format!</html>");
            okm.setVisible(true);
            okm=null;
            return false;
        }
        catch(ParseException ex1)
        {
            OKMessage okm=new OKMessage(mwcHost, "The field Date contains incorrect date!");
            okm.setVisible(true);
            okm=null;
            return false;
        }
    }
View Full Code Here


        if(jfcExport.getSelectedFile()==null)
            return;
        File fleInput=jfcExport.getSelectedFile();
        if(!jfcExport.getSelectedFile().exists())
        {
            OKMessage okm=new OKMessage(mwcMain, "The selected file does not exist!");
            okm.setVisible(true);
            okm=null;
            return;
        }
        IniHolder.WriteValue("ImportWorkDir", jfcExport.getSelectedFile().getAbsolutePath().substring(0, jfcExport.getSelectedFile().getAbsolutePath().lastIndexOf((int)File.separatorChar)));
        FileInputStream fisReader;
        InputStreamReader isrReader;
        BufferedReader brReader;
        try
        {
            fisReader=new FileInputStream(fleInput);
            isrReader=new InputStreamReader(fisReader);
            brReader=new BufferedReader(isrReader);
            Vector<Transaction> vctTrans=new Vector<Transaction>();
            String s=brReader.readLine();
            while(s!=null)
            {
                Transaction trans=Parse(s);
                if(trans==null)
                    throw new IOException("Invalid file format!");
                vctTrans.add(trans);
                s=null;
                s=brReader.readLine();
            }
            for(Iterator<Transaction> i=vctTrans.iterator(); i.hasNext();)
            {
                //Transaction trans=i.next();
                //System.out.println("--------------");
                //System.out.println(trans.amount);
                mwcMain.getSelectedTab().addTransaction(i.next());
                //mwcMain.getSelectedTab().addTransaction(trans);
                //System.out.println(((CardPaneController)mwcMain.getSelectedTab()).getCard().getBalance());
                //System.out.println("--------------");
            }
            fisReader.close();
            isrReader.close();
            brReader.close();
        }
        catch(IOException ex)
        {
            OKMessage okm=new OKMessage(mwcMain, "Unable to read the file or invalid file format!");
            okm.setVisible(true);
        }
    }
View Full Code Here

    }
    private boolean Validate()
    {
        if(ccpHost.getID().trim().length()==0)
        {
            OKMessage okm=new OKMessage(mwcHost, "The ID field is obligatory!");
            okm.setVisible(true);
            okm=null;
            return false;
        }
        try
        {
            if(!ccpHost.getCard().hasTransaction(Integer.parseInt(ccpHost.getID().trim())))
            {
                OKMessage okm=new OKMessage(mwcHost, "The designated ID was not found!");
                okm.setVisible(true);
                okm=null;
                return false;
            }
            else
                return true;
        }
        catch(NumberFormatException ex)
        {
            OKMessage okm=new OKMessage(mwcHost, "The ID field contain invalid character(s)!");
            okm.setVisible(true);
            okm=null;
            return false;
        }
    }
View Full Code Here

            //lblBalance.setText(mwcHost.getSelectedTab().getFormat().format(crdChange.getBalance()));
            mwcHost.getSelectedTab().UpdateBalance();
        }
        catch(NumberFormatException ex)
        {
            OKMessage okm=new OKMessage(mwcHost, "<html><body>Initial Balance field should contain a numeric value in ###.## format!</body></html>");
            okm.setVisible(true);
            okm=null;
        }
    }
View Full Code Here

    public NewGroupListener(ReporterController host){rcHost=host;}
    public void actionPerformed(ActionEvent e)
    {
        if(rcHost.jcbGroups.getItemCount()>=7)
        {
            OKMessage okm=new OKMessage((JFrame)rcHost.getOwner(), "You can not have more then seven groups!");
            okm.setVisible(true);
            okm=null;
            return;
        }
        InputBox ipGroup=new InputBox((JFrame)rcHost.getOwner(), "Enter the name of new group");
        ipGroup.setVisible(true);
View Full Code Here

                }
                fleImage.delete();
            }
            if(!fleImage.createNewFile())
            {
                OKMessage okm=new OKMessage(mwcMain, "Unable to save the file!");
                okm.setVisible(true);
                okm=null;
            }
            //BufferedImage biImg=(BufferedImage)img;//new BufferedImage(cmpSource.getWidth(), cmpSource.getHeight(), BufferedImage.TYPE_INT_RGB);
            ImageIO.write(biImg, "png", fleImage);
            //ImageIO.write(biImg, "gif", fleImage);//there is no gif Image writer in java v.1.5
            //ImageIO.createImageOutputStream(this);
            fdSave=null;
          //  biImg=null;
            strDirrectory=null;
        }
        catch(IOException ex)
        {
            OKMessage okm=new OKMessage(mwcMain, "Unable to save the file!");
            okm.setVisible(true);
            okm=null;
        }
    }
View Full Code Here

               Enumeration<Card> enCards=mwcHost.getProfile().getCards();
               while(enCards.hasMoreElements())
               {
                   if(enCards.nextElement().getName().trim().equals(txtName.getText().trim()))
                   {
                       OKMessage okm=new OKMessage(mwcHost, "The card with name "+txtName.getText().trim()+" already exists!");
                       okm.setVisible(true);
                       okm=null;
                       return;
                   }
               }
               if(txtName.getText().trim().length()==0)
               {
                   OKMessage okm=new OKMessage(mwcHost, "The \"Name\" and \"Initial amount of money\" fields are obligatory!");
                   okm.setVisible(true);
                   okm=null;
               }
               else
               {
                   try
                   {
                       crdNew=new Card(txtName.getText(), Double.parseDouble(txtValue.getText()), mwcHost.getProfile());
                       mwcHost.getProfile().addCard(crdNew);
                       mwcHost.LoadCard(crdNew, true);
                       mwcHost.UpdateCardNumbers(false);
                       dispose();
                   }
                   catch(NumberFormatException ex)
                   {
                       OKMessage okm=new OKMessage(mwcHost, "The field \"Initial amount of money\" contains invalid characters!");
                       okm.setVisible(true);
                       okm=null;
                   }
               }
            }
        });
View Full Code Here

        }
        FileWriter fwDBWriter=new FileWriter(mwcHost.getOpenedFile(), mwcHost.getProfile());
       
        if(!fwDBWriter.write(mwcHost.getPassword()))
        {
            OKMessage okError=new OKMessage(mwcHost, "The error occured while writing the file!");
            okError.setVisible(true);
            okError=null;
        }
        else
        {
            mwcHost.getProfile().resetModifyed();
View Full Code Here

        }
        return dblValid;
    }
    private void Report(String report)
    {
        OKMessage okm=new OKMessage(mwcHost, "<html><body>"+report+"</body></html>");
        okm.setVisible(true);
        okm=null;
    }
View Full Code Here

                    mwcMain.getSelectedTab().UpdateBalance();
                    blnGotResponse=true;
                }
                catch(NumberFormatException ex)
                {
                    OKMessage okm=new OKMessage(mwcMain, "<html><body>Initial Balance field should contain a numeric value in ###.## format!</body></html>");
                    okm.setVisible(true);
                    okm=null;
                    ibNewBalance=null;
                    nfDec=null;
                }
            }
View Full Code Here

TOP

Related Classes of Messages.OKMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.