Validating a JTextField having a float or double value.

Hello,
I need help in validating a JTextfield which will accept a float or double value because it the deposit field and it shouldn't be of length more than 7 before the decimal and 2 after the decimal.That is it should be of length 10.I have written the following code for the validation.
txtDeposit.addKeyListener(new KeyAdapter(){
//Accept only integer value
          public void keyTyped(KeyEvent e){
          char c = e.getKeyChar();
if((txtDeposit.getText()).length() == 10)
          if (!(Character.isDigit(c)))
          if(!Character.isISOControl(c))
          getToolkit().beep();
          e.consume();
          });//end of txtDeposit*/
Please help.

use javax.swing.InputVerifier
import java.awt.BorderLayout;
import java.awt.Toolkit;
import javax.swing.InputVerifier;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class VerifyInput extends JFrame {
    public VerifyInput(){
        super("Input Verifier");
        this.setSize(200, 200);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JTextField txt = new JTextField();
        txt.setInputVerifier(new CheckInput());
        this.getContentPane().add(txt, BorderLayout.NORTH);
        JButton btnMoveFocus = new JButton("CLick");
        this.getContentPane().add(btnMoveFocus, BorderLayout.SOUTH);
    public static void main(String[] args) {
        VerifyInput f = new VerifyInput();
        f.setVisible(true);
    class CheckInput extends InputVerifier{
        private int lengthBeforeDot = 7;
        private int lengthAfterDot = 2;
        public CheckInput(){
        public CheckInput(int lengthBeforeDot, int lengthAfterDot){
            this.lengthAfterDot = lengthAfterDot;
            this.lengthBeforeDot = lengthBeforeDot;
        public boolean verify(JComponent input) {
            boolean correct = true;
            try {
                JTextField tField = (JTextField) input;
                String text = tField.getText();
                if(text.length() == 0){
                    return true;
                if ((correct = isDoubleOrFloat(text))) {
                    correct = isFormatCorrect(text);
            } finally {               
                if(!correct){
                    Toolkit.getDefaultToolkit().beep();
                    System.out.println("Not Correct");
                }else{
                    System.out.println("Correct");
            return correct;
        private boolean isDoubleOrFloat(String text){
            try{
                Double.parseDouble(text);
            }catch(NumberFormatException nfe){
                return false;
            return true;
        private boolean isFormatCorrect(String text){
            int dotIndex = text.indexOf('.');
            if(dotIndex < 0){
                return text.length() <= lengthBeforeDot;
            String beforeDecimal = text.substring(0, dotIndex - 1);
            if(beforeDecimal.length() >= lengthBeforeDot){
                return false;
            String afterDecimal = text.substring(dotIndex + 1);
            if(afterDecimal.length() > lengthAfterDot){
                return false;
            return true;
}

Similar Messages

  • Validation of JTextField to accept negative and positive values

    Hi,
    I have a question. I have a jTable populated with the fieldname
    in the first column and datatype in the second column.
    I would like to place a JTextField component in the frame
    depending on the data type. So, if a row is selected in the table, the
    datatype of that fieldname is retrieved and depending on that data type
    I want a JTextField to be displayed.
    Now, if the data type is of Integer type, I want the JTextfield to
    accepts Integers only(positive). I have created a class that extends JTextfield.
    But, I want the text field to accept negative integers also. Can anyone please guide me ?

    Hi,
    I wrote an extension of JTable that provides better rendering and editing support for:
    Color
    Font
    Locale
    Integer
    int
    Long
    long
    Short
    short
    Byte
    byte
    BigInteger
    Double
    double
    Float
    float
    BigDecimal
    and some more
    To allow only positive values for the type integer you could use:
    JXTable myTable = new JXTable(...);
    myTable.setDefaultEditor(Integer.class, new IntegerCellEditor(0, Integer.MAX_VALUE, <some locale>));The number editors are based on JFormattedTextField.
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JXTable.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/IntegerCellEditor.html
    Homepage:
    http://www.softsmithy.org
    Download:
    http://sourceforge.net/project/showfiles.php?group_id=64833
    Source:
    http://sourceforge.net/cvs/?group_id=64833
    For more information about the number fields have a look at he following thread:
    http://forum.java.sun.com/thread.jspa?threadID=718662
    -Puce

  • Precision with float and double values

    Hi, does anyone knows how can i get more precise calculations with floating point numbers? Let's see an example:
    public class Teste {
    public static void main(String args[]) {
    float i = 0;
    while (i<=10) {
    System.out.println(i);
    i=i+0.1f;
    /* output
    0.0
    0.1
    0.2
    0.3
    0.4
    0.5
    0.6
    0.70000005
    0.8000001
    0.9000001
    1.0000001
    1.1000001
    1.2000002
    1.3000002
    1.4000002
    1.5000002
    1.6000003
    1.7000003
    1.8000003
    1.9000003
    2.0000002
    2.1000001
    2.2
    2.3
    2.3999999
    2.4999998
    2.5999997
    2.6999996
    2.7999995
    2.8999994
    2.9999993
    3.0999992
    3.199999
    3.299999
    3.399999
    3.4999988
    3.5999987
    3.6999986
    3.7999985
    3.8999984
    3.9999983
    4.0999985
    4.1999984
    4.2999983
    4.399998
    4.499998
    4.599998
    4.699998
    4.799998
    4.8999977
    4.9999976
    5.0999975
    5.1999974
    5.2999973
    5.399997
    5.499997
    5.599997
    5.699997
    5.799997
    5.8999968
    5.9999967
    6.0999966
    6.1999965
    6.2999964
    6.3999963
    6.499996
    6.599996
    6.699996
    6.799996
    6.899996
    6.9999957
    7.0999956
    7.1999955
    7.2999954
    7.3999953
    7.499995
    7.599995
    7.699995
    7.799995
    7.899995
    7.9999948
    8.099995
    8.199995
    8.299995
    8.399996
    8.499996
    8.599997
    8.699997
    8.799997
    8.899998
    8.999998
    9.099998
    9.199999
    9.299999
    9.4
    9.5
    9.6
    9.700001
    9.800001
    9.900002
    */

    http://forum.java.sun.com/thread.jsp?forum=31&thread=357174

  • VS2013 x64 p/invoke issue with C++ functions returning float or double values to C#

    I originally posted this on the Windows Insiders forum, but I was directed to either TechNet or MSDN as this was deemed too technical. 
    I do understand that Windows 10 is still in preview mode, and VS2013 doesn't officially support it yet, but I just wanted to make a note of this, and ensure it gets fixed  :)  
    The issue:
    I ran across what appears to be a .Net bug in Windows 10.  This issue does NOT appear when using either Windows 7 or Windows 8 Enterprise.  This also does NOT appear when running an x86 build.  This is an x64 specific issue, and occurs in
    both release and debug configurations. 
    If you have a C++ function that looks like this:
    double GetValueDouble()
      return 555.555;
    And on the C# side:
    [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
    public static extern double GetDoubleValue();
    static class Program
      static int Main(string[] args)
        double val = GetDoubleValue();
        Console.WriteLine("val = {0}", val);
    I'd expect the output to be:
    val = 555.555
    But I actually get something like this:
    val = -2.0608193755203536E+262
    This has been reproduced on two different machines, both running Windows 10. 
    Is this a known bug?  I searched the forums, but didn't find anything relevant.

    I can repro, but only running under the VS2015 preview debugger. Running the console app directly gives the 555.555 value:
    C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug>dir
     Volume in drive C has no label.
     Volume Serial Number is C285-B76C
     Directory of C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug
    02/18/2015  06:42 PM    <DIR>          .
    02/18/2015  06:42 PM    <DIR>          ..
    02/18/2015  06:45 PM             4,096 ConsoleMain.exe
    02/18/2015  06:37 PM               187 ConsoleMain.exe.config
    02/18/2015  06:45 PM            11,776 ConsoleMain.pdb
    02/18/2015  06:41 PM            45,568 CPP_DLL.dll
                   4 File(s)         61,627 bytes
                   2 Dir(s)  89,595,490,304 bytes free
    C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug>ConsoleMain.exe
    val = 555.555
    C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug>dumpbin cpp_dll.dll /headers
    Microsoft (R) COFF/PE Dumper Version 11.00.60610.1
    Copyright (C) Microsoft Corporation.  All rights reserved.
    Dump of file cpp_dll.dll
    PE signature found
    File Type: DLL
    FILE HEADER VALUES
                8664 machine (x64)
                   8 number of sections
            54E54D6A time date stamp Wed Feb 18 18:41:46 2015
                   0 file pointer to symbol table
                   0 number of symbols
                  F0 size of optional header
                2022 characteristics
                       Executable
                       Application can handle large (>2GB) addresses
                       DLL
    How about yourself? Does it repro outside of the VS debugger?

  • Float and Double - 5.1 divide by 3.0

    Hi everyone,
    I am quite new to java programming in term of using it. I wrote a test class to learn about float and double. However when I wrote the below code, I got a strange result. So, I wonder if java's float and double have any kind of exception I should be aware of. This won't happen if I just change from 3 to other numbers. Any suggestion? Thanks in advance.
    public class MathTest {
    public static void main (String args[]) {
    float f1 = 5.1F;
    float f2 = 3.0F;
    double d1 = 5.1;
    double d2 = 3.0;
    System.out.println("Float result : " + f1/f2);
    System.out.println("Double result : " + d1/d2);
    Result:
    Float result : 1.6999999
    Double result : 1.7

    This is due to the way that binary numbers convert to digital numbers and is expected. See these threads for explanations:
    http://onesearch.sun.com/search/onesearch/index.jsp?qt=%2Bprecision+%2Bwrong+double&col=developer-forums&rf=0&chooseCat=allJava&subCat=siteid%3Ajava

  • What is the match of float or double data type in abap?

    I have tried p, but I could not handle decimal numbers such as 10.6 or 10,6(no matter which one is preferred, the question is the same...).
    How can I handle these numbers?
    Thanks.

    Hi
    Hope you know about FLOAT and Double.But you can use the same P for handling decimal places...
    Use like this.
    Data :Deci type P DECIMALS 2.
    Get bckif you are getting error still...
    Reward All Helpfull answers..........

  • How do i convert a float value to a double value?

    How do i convert a float value to a double value? HELP PLEASE!! im very stuck!! i gota float data type and i need to convert it to a double data type in order to use it in another operation.....
    thank u so much!

    safe dint realise ppl were so arrogant. thanks for the reply but less of the sarcasm!

  • How to format floats (or doubles ) but not converting to String?

    Hi everybody,
    my question is simple:
    I have a number,lets say 51,4567321 and i want to format it ,as a float or double ,as 51,45.
    One way is to do:
    float x=((hits * (float) 100) / this.getAccesses());
    DecimalFormat perCentFormatter = new DecimalFormat("00.00");
    String formattedNum=this.perCentFormatter.format(x);and that will create a string "51,45".
    But how do i do to create a float or double or anything else that holds the value with 2 decimal points after mantissa?e.g XX,XX
    Thank you very much,
    Chris

    A few options:
    1) just live with it. The float and double formats hold their values in binary, you know, and you only have approximations of multiples of tenth and one-hundreds of unity. It's all just approximations for those types. C'est la vie.
    2) Use java.math.BigDecimal, which gives you control over rounding.
    3) Change your design, so you use integers with the lower unit. So if the float currently "51,23" represents 51 Euros and 23 cents (what's the word? Europennies?), then you'd use an int of 5123 to represent five thousand one hundred and twenty-three cents.

  • How can I put validation for JTextField when gotfocus and lostfocus

    Hi,
    How can I put validation for JTextField when gotfocus and lostfocus ?
    Thanks
    Wilson

    You add a focusListener to the control you wish to monitor. In the focusLost() handler you do whatever, in the focusGained() handler you do whatever.

  • Float vs Double

    First post...
    Ok this is a complete Noob question. For those that have gone through the "Programming in Objective-C" book by Stephen G. Kochan, I'm getting hung up in Chapter 6 when trying to implement a seemingly simple calculator class. The results of the code in the book are nowhere near what I'm getting. Through troubleshooting I've narrowed it to calling the variables in the program Float vs. Double. For instance:
    Calling "value1" and "value2" as double (as it does in the book) gives me the wrong result:
    double value1, value2;
    I get the user imput of value1 and value2 (along with the arithmetic operator) like so:
    scanf ("%1f %c %1f", &value1, &operator, &value2);
    adding 1+1 (the assignments of value1 and value2) gives me a result of .02. Last I checked this is wrong. Adding 2+2 gives me 4.00. Ok that's great. But adding 2+3 gives me 34.00. And get this... adding 9+9 gives me 524288.25. WHAT ON EARTH???
    By the way, in case you haven't figured it out the printf command looks something like this:
    printf ("The result is %.2f\n", [deskCalc accumulator]);
    Ok for kicks I decided to find out what would happen by calling "value1" and "value2 as a FLOAT. It seems to give me the right result, everytime:
    float value1, value2;
    Adding 1+1 gives me 2.00 (perfect). Adding 2+2 gives me 4.00 (perfect). And adding 2+3 gives me 5.00 (again perfect). Adding 9+9 gives me 18.00 (that's 4 in a row). So why on earth should changing it from double to float make any difference?? The book uses double so I should be able to as well, yes?
    Again, be easy on me. I have never had any programming experience beyond simple Access and Excel macros... and some Adobe After Effects expressions so I'm sure it's a simple answer. And if you need me to post the full code somewhere let me know how. Finally if any of you know of a discussion board specifically for readers of the "Programming in Objective-C" book I mentioned that would be awesome too. Thanks everyone in advance!
    - Snoq
    G5 & Powerbook   Mac OS X (10.4.3)  
    G5 & Powerbook   Mac OS X (10.4.3)  

    Thanks James and Daniel. Here is the code:
    // main.m
    // prog1
    // Created by XXXXXX on 12/13/05.
    // Implement a calculator class
    #import <objc/Object.h>
    #import <stdio.h>
    @interface Calculator: Object
    double accumulator;
    // accumulator methods
    -(void) setAccumulator: (double) value;
    -(void) clear;
    -(double) accumulator;
    // arithmetic methods
    -(void) add: (double) value;
    @end
    @implementation Calculator;
    -(void) setAccumulator: (double) value
    accumulator = value;
    -(void) clear
    accumulator = 0;
    -(double) accumulator
    return accumulator;
    -(void) add: (double) value
    accumulator += value;
    @end
    int main (int argc, char *argv[])
    Calculator *deskCalc = [[Calculator alloc] init];
    double value1, value2;
    char operator;
    printf ("Type in your expression.\n");
    scanf ("%1f %c %1f", &value1, &operator, &value2);
    [deskCalc setAccumulator: value1];
    if ( operator == '+')
    [deskCalc add: value2];
    else
    printf ("Invalid");
    printf ("%.2f\n", [deskCalc accumulator]);
    [deskCalc free];
    return 0;
    For those following the book, if this seems light or incomplete, it's because I've taken out the "multiply", "divide" and "subtract" methods for purposes of simplicity and troubleshooting. Thanks for everyone's help in this.
    - rjfiske (aka Snoqualmie)
    G5 & Powerbook   Mac OS X (10.4.3)  

  • JSlider using double values instead of INT

    I need to create a slider that uses double values instead of ints...
    the default constructor is JSlider temp = new JSlider(JSlider.HORIZONTAL, int, int, int)....but i need to use
    JSlider temp = new JSlider(JSlider.HORIZONTAL, double,double,double)
    I want my slider to go from like 1.0 to 10.0 ....any ideas?
    thanks

    me has ritten a sample code fur ya... mite help...
    sorrie... not commented properly...
    import java.awt.event.*;
    import java.util.Vector;
    import javax.swing.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class Test extends JPanel {
         //Variable Declarations...
         JPanel valuesPanel;
         public JSlider slider;
         public JTextField midText;
         public JTextField lowText;
         public JTextField highText;
         int precision=1000;//to convert to double...(100-> 2decimal places, 1000->3decimal places.......)
         double lowLimit = 0;
         double midLimit = 5;
         double highLimit = 10;
         public Test() {
              initialize();
              addListeners();
              initComponents();
              addComponents();
         public void initialize() {
              valuesPanel = new JPanel();
              highText = new JTextField();
              midText = new JTextField();
              lowText = new JTextField();
              slider = new JSlider();
         public void addListeners() {
              addTextListenerTo( highText );
              addTextListenerTo( midText );
              addTextListenerTo( lowText );
              // if the slider is moved, the value of the mid will be updated in the testbox.
              // Sliders work on integers and not on double. so the limits are divided by precision to get a double number.
              slider.addChangeListener(
                   new ChangeListener() {
                        public void stateChanged( ChangeEvent e ) {
                             double n = ( double ) ( ( JSlider ) e.getSource() ).getValue();
                             midLimit = n / precision;
                             midText.setText( Double.toString( midLimit ) );
         * Sets different attributes and properties of the components
         public void initComponents() {
              highText.setText( Double.toString( highLimit ) );
              midText.setText( Double.toString( midLimit ) );
              lowText.setText( Double.toString( lowLimit ) );
              slider.setPaintTrack( true );
              slider.setPaintTicks( true );
              slider.setMinimum( ( int ) ( lowLimit * precision ) );
              slider.setValue( ( int ) ( lowLimit * precision ) );
              slider.setMaximum( ( int ) ( highLimit * precision ) );
         * Add all the components to the container (Panel).
         public void addComponents() {
              setLayout( new BorderLayout() );
              valuesPanel.setLayout( new GridLayout( 3, 3, 5, 5 ) );
              valuesPanel.add( new JLabel("Low") );          
              valuesPanel.add( highText );
              valuesPanel.add( new JLabel("Mid") );
              valuesPanel.add( midText );
              valuesPanel.add( new JLabel("High") );
              valuesPanel.add( lowText );
              add( valuesPanel, BorderLayout.CENTER);
              add( slider, BorderLayout.SOUTH);
         * Adds Focus and Action Listeners to the TextFields
         public void addTextListenerTo( JTextField textField ) {
              textField.addFocusListener(
                   new FocusAdapter() {
                        public void focusLost( FocusEvent evt ) {
                             updateLimits( ( JTextField ) evt.getSource() );
                        public void focusGained( FocusEvent evt ) {
                             String tempOldString = ( ( JTextField ) evt.getSource() ).getText();
              textField.addActionListener(
                   new ActionListener() {
                        public void actionPerformed( ActionEvent evt ) {
                             updateLimits( ( JTextField ) evt.getSource() );
         * This function is called when any action is performed on the text. It checks
         * if the value is valid and if not it displays a message. Also it updates the
         * slider value.
         *@param textField
         public void updateLimits( JTextField textField ) {
              double tempN = 0;
              try {
                   tempN = Double.parseDouble( textField.getText() );
                   if ( textField.equals( lowText ) ) {
                        lowLimit = tempN;
                        slider.setMinimum( ( int ) ( lowLimit * precision ) );
                   else if ( textField.equals( highText ) ) {
                        highLimit = tempN;
                        slider.setMaximum( ( int ) ( highLimit * precision ) );
                   else if ( textField.equals( midText ) ) {
                        midLimit = tempN;
                        slider.setValue( ( int ) ( midLimit * precision ) );
              } catch ( Exception ex ) {
                   JOptionPane.showMessageDialog( this, "Not a Number", "Error !!!", JOptionPane.WARNING_MESSAGE );
                   textField.setText( "0" );
         public static void main(String args[]) {
         JFrame f=new JFrame("test Frame");
         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         f.getContentPane().add(new Test());
         f.pack();
         f.setVisible(true);

  • Getting Double values in Purchasing cube

    hi experts,
    I m getting double values for 0po_items and ocontr_item in purchasing data cube 0pur_c01.
    i have also applied the test rule in routine ,that values are fine.
    but in cube values are getting double.
    please help..........

    Hi,
    It seems like you are loading data into cube using 2 DataSource  and there is no (consolidated) dso in between.
    If the KF say (qty) you are mapping from both the datasource to the cube, it is going to be doubled in report as 2 records will be found in cube.
    I suggest try to load a single valid record (PO and lien item) one by one into the cube and do check the values in cube for each process. You will get good idea how cube behave while loading data from diff. sources.
    Also try to bring in the one dso where you consolidate the data as per report requirement and then move that data into Cube, will give you required output.
    Thank-You.
    Vinod

  • Can j2me draw line with double values.

    Hi,
    Can any body know how to darw line in j2me with double values.
    I don't want use draw Line with int.
    Shall i use svg or j2me has solution.
    Thanks and regards,
    Rakesh.

    not possible
    graphics.drawLine(float,float,float,float);...there's no such method in MIDP API: [click here for javadoc of Graphics class methods|http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Graphics.html#drawLine(int,%20int,%20int,%20int)]

  • SPListItemCollection.GetDataTable() delivers wrong Double Values

    Hi there,
    i have a Problem with the .getDataTable() Method of a SPListItemCollection Object. Within the SPListItemCollection all Double Values are displayed correct. But the DataTable Edition puts the decimal point to the End of the number. And i have no idea why,
    and how to get rid of this. Any hints?
    DataTable dt = new DataTable("ChargeData");
    listItems[0]["PRICE"] -> 107.10 | object {double}
    dt = listItems.GetDataTable();
    dt[0]["PRICE"] -> 10071.0 | object {double}
    P.s.: If this is realted in some way, the initial List for the SPListItemCollection is a External List with a MSSQL Connection. The 'Price' Column within the SQL Server is a "float".
    My Best Regards
    THO
    EDIT #1
    I've try to figure out when this problem appears. Always or only on BCS lists, so i tried (with Powershell), and found out, this seems to be a Problem with the Autogenerated BCS List.
    $nonbcslist.Items[0]["PRICE"] -> 107,10 | double
    $dt = $nonbcslist.Items.GetDataTable()
    $dt.Rows[0]["PRICE"] -> 107,10 | double
    $bcslist.Items[0]["PRICE"] -> 107,10 | double
    $bcsdt = $bcslist.Items.GetDataTable()
    $bcsdt.Rows[0]["PRICE"] -> 10710 | double

    I noticed that in one example you are using a period to segment the double and in the other a comma. I wonder if that is somehow tied into the wrong conversion when returning a data table.
    I have seen GetDataTable() break some other formatting in the past, specifically when working with multi-select user fields. Your best bet may be to iterate through the collection and manually populate a blank table.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • How can I limit a double value to two decimal place?

    How can I limit a double value to two decimal place?
    Java keeps on adding zero's to a simple double subtraction:
    1497 - 179.64 = 1317.3600000000001The answer must have been simply: 1317.36

    If the trouble is with output ...
    If the trouble is with value accuracy ...The trouble is with OPs understanding of and/or expectations of IEEE 754 floating point numbers. o_O
    [And it's probably a view (output) issue.]
    how can i actually use numberformat to cut those
    unwanted decimal places?Read the API - Puce already provided the link.

Maybe you are looking for

  • Deleting records from a table

    Hi I have to delete a table which is having nearly 9 crore records, I deleted some of the old records which is nearly 10-15 lakhs records and I have checked the free size of the tablespace after giving alter table <table name> deallocate unused, but

  • Tutorial on creating a scrolling thumbnail menu in AS 3.0

    I've found several good tutorials in AS2.0 on creating a scrolling thumbnail menu bar for adding to a photo gallery, but nothing in AS3.0.  Anyone have a tutorial or code they'd like to share?

  • Delete orignal after making changes in iPhoto 11

    When I compare the Master and Previews folders I find both the original and the "corrected" copies of the same photo.  Is there a way to delete the original without doing a folder by folder comparison?  And is it safe to delete directly from the Mast

  • ITunes 4.9, 1st gen iPod, OS 10.3.9

    Here's a good one: I have a 1st gen 5gig iPod, I run 10.3.9 on my G4 733 and have iTunes 4.9. I attach my iPod through a perfectly operative firewire port using a perfectly operative firewire cable and: ¥ iTunes launches and the entire system freezes

  • Itunes error while restore backup

    hi while i use to restore my privious backup on my iphone 3g i get this error and itunes doesn't do it : error picture : http://img214.imageshack.us/img214/9559/capturepwz.jpg