Problem with backspace

Please help with this small problem have been coding a calculator program for several weeks and have everything working except the backspace button would really appreciate some help the code for my action performed class which would contain the code is posted below thanks in advance
     public void actionPerformed(ActionEvent e){
               char currentOperator;
               String newNumberField = newTextField.getText();
               if(!beenBefore){
                    num1 = new Integer(newNumberField).intValue();
                    lastOperator = e.getActionCommand().charAt(0);
                    currentOperator = e.getActionCommand().charAt(0);
                    beenBefore = true;
               else{
                    num2 = new Integer(newNumberField).intValue();
                    currentOperator = e.getActionCommand().charAt(0);
                    switch(lastOperator){
                         case '+': num1 = num1+num2;
                                     break;
                         case '-': num1 = num1-num2;
                                     break;
                         case '*': num1 = num1*num2;
                                     break;
                         case '/': num1 = num1/num2;
                                     break;
                    lastOperator = currentOperator;
               if(currentOperator == '=')
                    newTextField.setText(String.valueOf(num1));
               else
                    newTextField.setText("");
               if(currentOperator == 'C')
                    beenBefore = false;
            if(e.getActionCommand().equals("1/x"))
                  newTextField.setText(String.valueOf(1/num1));
              if (e.getActionCommand().equals("Backspace"))

why even bother posting a reply if ur goin to be like that I'v tried several methods keep getting errors heres one I tried
if (e.getActionCommand().equals("Backspace")
  String.valueOf(num1) = String.valueOf(num1)(0, String.valueOf(num1) - 1);I'm only looking for some help man an it aint homework either whats ur problem

Similar Messages

  • Problem with backspace on JFrame

    Hello,
    I have a problem on a JFrame. Indeed, I add a keyListener to the frame, but the "Bakcspace" don't work. There is anything when a I press on Backspace (with KeyTyped, KeyReleased and KeyPressed). All other keys are working.
    Thanks.

    the solution of the problem is :
    Version note: This page reflects the focus API introduced in released 1.4. As of that release, the focus subsystem consumes focus traversal keys, such as Tab and Shift Tab. If you need to prevent the focus traversal keys from being consumed, you can call
    component.setFocusTraversalKeysEnabled(false)
    on the component that is firing the key events. Your program must then handle focus traversal on its own. Alternatively, you can use a KeyEventDispatcher to pre-listen to all key events. The focus page (in the Creating a GUI with JFC/Swing trail) has detailed information on the focus subsystem.

  • Problems with backspace in ServiceDesigner on IBM

    Hi
    Running ias9i we 1.1.
    When using the ServiceDesigner on a ex. Dell the backspace key functions fine, but when running on an IBM pc / laptop the backspace key do not function.
    Please advise
    null

    Hi,
    check that you aren't using JDK 1.3 on the IBM laptop.

  • Problem with backspace on Iphone 4.

    I have an Iphone 4 and I can't insert a word without deleting the entire sentence.

    Start at the bottom of page 25 "Editing Text":
    The User Guide is available at http://support.apple.com/manuals/ or downloadable from iTunes as an iBook.

  • Keyboard problems with Enter, delete, backspace, and right/left arrows

    In some applications, such as Yahoo and this message block right now !!, when composing a message, the arrow keys and delete, backspace keys become non responsive. Various ones will work on a random basis.
    I am getting double "carriage returns" also. Maybe this is why in Omegle when I press ENTER, it will not post a chat message; it will bring up a scroll box and for me to post the comment, I have to use the mouse to click ENTER.
    I have changed batteries in my keyboard, uninstalled /reinstalled Firefox. I have checked the above websites in Chrome and other browsers, and there are no problems.
    This has happened before, I don't recall what the solution was or if it just went away.'''
    Affected sites -- at least these
    http://us.mg6.mail.yahoo.com/neo/launch?ncrumb=Fx5R4O7ccqb&.rand=1041364415&nmig=yes#
    http://omegle.com/
    https://support.mozilla.com/en-US/questions/new?product=beta&category=b2&search=Keyboard+problems+with+Enter%2C+delete%2C+backspace%2C+and+right%2Fleft+arrows&showform=1

    PROBLEM SOLVED: http://forum.archlinux-br.org/viewtopic.php?id=1257
    Solution posted on Brazilian Archlinux forum. Credits to user "920608".
    [cache]
    /etc/xorg.conf
    Section "Files"
             #RgbPath "/usr/X11R6/lib/X11/rgb"
    EndSection
    Section "ServerFlags"
               Option "AutoAddDevices" "False"
    EndSection
    C'ya

  • Problem with the calculator and modifications needed

    i have got a problem with the calculator on my iphone i.e i cannot find any DEL key or Backspace....the problem is when typing a long value if one number is entered wrong we should start again.
    EXAMPLE...if i need to type    114678047 * 345612
    if acidentally if i type 114678047 * 3455           ( then i should start over typing  "C"  key)
    i should start over to type the whole data..if we have a delete key we can just correct it right away and continue.....rather than starting over
    we can find this feature in all the other smart phones , i dont know why apple coudnt find that
    even every scientific calculator have a DEL key...
    Thanks
    vickyk7

    FEEDBACK
    If you want to give Apple feed back then do it here http://www.apple.com/feedback/iphone.html

  • I have been having problems with YouTube functionality when using Firefox, some of them having begun with the latest Firefox update

    After a fairly recent update, I began having the option to paste text disappear, I've had backspace cause the browser to go back to the previous page while in a text box, and other issues which are apparently a matter of Firefox not recognizing the fact that I am typing in a text box.
    After the last update, suddenly YouTube video page URL links no longer translate into links containing the title of the video, and also things like the use of bookend asterisks in order to have text appear in bold typeface no longer work.

    i have the same problem with the above..firefox is running too slow with the games in facebook..but it runs good when browsing my updates, msgs, photos...firefox is totally opposite of IE..IE is faster with the games and slow while browsing..i love to use mozila but when i do games it really pisses me off...hope you could help me..

  • Keyboard mapping problem with sunstudio

    I'm a new sunstudio user and am having trouble with a setup issue. When I run sunstudio 11 from a sunray with a Sun keyboard all works fine (except the sunray has far too small of screen and it drive me crazy). When I run with my linux desktop being the x-server then none of the special keys (home, end, arrows, backbspace, enter, etc.) work correctly in sunstudio. All other gui apps I've tried (gedit, gvim, staroffice, web browser, etc.) work fine from my linux/pc keyboard.
    Using google I discovered xev. It shows the keycode and keysym that is interpreted for each keyboard stroke. When I compare the output from my linux/pc keyboard vs. the sun keyboard connected to the sunray I see the expected differences in keycode, but the keysym and resulting interpretation (e.g. BACKSPACE) is the same. Yet sunstudio ignores any keystroke except normal alphabet characters that come from my linux/pc keyboard.
    When using my linux/pc keyboard I'm in one of two configs (both act the same):
    - ssh -X hostname
    OR
    - Xephyr :1 -screen 1250x975 -query hostname &
    Thanks for any help.
    cb

    There is a known problem related to control keys in the netbeans GUI.
    http://www.genunix.org/wiki/index.php/Sun_Studio_FAQs#IDE_-TheSun_Studio_IDE_is_ignoring_my_control_keys
    It's hard to tell from your message where the programs are
    executing from.
    Run two X programs next to each other, running on the same machine,
    and displaying to the same X server. Verify that one of them can see
    ALT keys (for example) and the other one can't. Then you know it's
    a problem with the application program, and not due to your keyboard.
    The Sun Studio IDE has no idea what physical keyboard you're using.
    It only sees the keysyms from the X server.

  • Problem with up-arrow on a long command line

    I often use the "terminal" window to open up a connection (via ssh) to linux and unix boxes.
    While I'm logged into the remote computer and I try to edit a previous command, I notice that my
    display gets all fouled up if the command that I'm trying edit is very long. I'm unable to do the
    usual unix tricks of up-arrowing to the command and then backspacing through it to perform my edits. Often my only recourse is to retype the entire command which is a pain and prone to error.
    I'm using bash as my Mac shell and tcsh on the remote machines.
    Has anybody experienced this? Any hints?

    It's a visual-only problem with Terminal.app.
    Other than the cosmetic effect, you will find that the editing works as you expect - you might just have to be psychic with regards to telling how far to backspace and where/when to make your edits.
    The problem has been there for a long time. You might have better luck setting the terminal to a different emulation (Terminal -> Preferences -> Declare terminal as:) to see if one of the other emulations work for you, or use a different terminal application such as iTerm

  • Hi guys. i have some problem with a link from a pdf on-line,when i click on it,the page adds a "%" at the and of the link and says "page not found" because of it

    Hi guys. i have some problem with a link from a pdf on-line,when i click on it,the page adds a "%" at the and of the link and says "page not found" because of it.
    This happens only when a load my pdf file on my server, because if i click on the link when the file is on my iPad, the page opens without problem.
    Any help please?
    thanx

    the % sign is often used when there's a space in a name. HTML doesn't like spaces so it fills them with % or %20
    try, on the end of that link, see if there's a space built into the page or the link when the page was made
    On the web address you may be able to 'backspace' at the end and erase that space to get the address, but whomever made the page possibly put a mistake in the link

  • Problems with composing a message with Gmail in RTL mode

    It happens in RTL mode when you mix Hebrew text with numbers or with English text.
    It happens only in Firefox. No problem with Chrome or IE browsers for example.
    Steps to reproduce:
    1. Type some Hebrew text without hitting the "enter" key. like שנה טובה
    Gmail correctly identifies the text as being from an RTL language and aligns it to the right (RTL mode)
    2. At the end of the Hebrew text type some English text (or some numbers ). Happy new year January 2015
    So you end up with a line with "Happy new year January 2015 שנה טובה"
    3. Start clicking the Backspace key. After a 3-6 clicks the backspace is not responding. (same bad behavior with the right and left navigation keys).
    Tested in a new/fresh profile.
    Also tried it with a different gmail account and got same problems.
    Firefox 34
    Win 7 x64

    You can try to experiment with these two prefs on the <b>about:config</b> page;
    *bidi.texttype (1) 1:Charset 2:Logical 3:Visual (selection -> 3)
    *bidi.edit.caret_movement_style (2) 0:Logical 1:Visual 2:Visual|Logical:selection
    *http://kb.mozillazine.org/bidi.edit.caret_movement_style
    See the comments about bidi prefs in this file (open via the location bar):
    *resource://gre/File:greprefs.js

  • Problem with starting my phone back up

    Hello
    I'll shortly sum up the problems with my blackberry curve 9360.
    My phone is 4 months old I bought it in a Belgian shop. I havn't had many problems with it before, I barely added any apps besides 2 free youtube players one about a month ago and the other 3 months ago. Yesterday night the battery died on me for one of the first times since I got the phone, now today when I try to start it up it goes crazy.. The screen freezes on my clock and I can't do anything, sometimes it changes to the "Enter pin code" screen and when I try to type in my pin nothing happens till after a few minutes then it either turns off or goes even more crazy. I have tried a lot of things to resolve the problem but nothing helped..
    This is a list of the things I tried that didn't help:
    -Remove battery.
    -Update my phone to a newer version through BlackBerry Desktop Software.
    -Set phone back to an earlier back-up.
    -Safe Boot (holding backspace button)
    Also noticable my BlackBerry Desktop Software can connect to my BlackBerry.
    If you have any further information needed to resolve my issue please ask and thanks!

    Hi Sedem
    Welcome to the Community
    Please never allow your Battery go below 10 % it decreases the Battery life,And also you had aleady tried a lots of think But still I prefer you perform a Clean reload of your Device Software after that Restore only your important data from your previous Backup like Contacts and Calender entries No application from previous Backup.
    KB11320 : How to perform a clean reload of the BlackBerry Device software using BlackBerry desktop software for windows.
    Please try it and let us know.
    Prince
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Serious problem with xorg - keyboard and mouse locks all the time.

    In the last week I've notices serious problems with xorg.
    After some event, I am not sure which one, keyboard stops responding.
    Mouse cursor works, but I can't click on anything.
    I can't switch to text console.
    But I can kill xorg with CTRL+ALT+BACKSPACE.
    Have you noticed something similiar?
    I use xfce4, [testing] repository.

    Jacek Poplawski wrote:
    In the last week I've notices serious problems with xorg.
    After some event, I am not sure which one, keyboard stops responding.
    Mouse cursor works, but I can't click on anything.
    I can't switch to text console.
    But I can kill xorg with CTRL+ALT+BACKSPACE.
    Have you noticed something similiar?
    I use xfce4, [testing] repository.
    I had that a few days ago, couldn't reproduce it. I was also running xfce4. I havn't had it today and im running xfdesktop+xfce-mcs-manager+pekwm+xfce4-panel... so it may have been xfwm4.
    James

  • Problem with radeon driver and Xorg

    Hoping someone can help with this problem.
    I would like to try and use the open source ati driver over the proprietary fglrx driver, however when I use this driver and I try to test my Xorg configuration it enters into X without any problems (mouse cursor appears and is functional) but when I Ctrl+Alt+Backspace to exit back to the console my screen resolution is completely distorted so that I can't read anything.  I can enter commands and can only use a reboot command to get it functional again.  I do not have this problem with the fglrx driver.
    I have a Dell Inspiron E1505 laptop with an ATI Mobility X1400 graphics card.
    Here is my xorg.conf if it helps:
    Section "ServerLayout"
    Identifier "X.org Configured"
    Screen 0 "Screen0" 0 0
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
    EndSection
    Section "Files"
    RgbPath "/usr/share/X11/rgb"
    ModulePath "/usr/lib/xorg/modules"
    FontPath "/usr/share/fonts/misc"
    FontPath "/usr/share/fonts/100dpi:unscaled"
    FontPath "/usr/share/fonts/75dpi:unscaled"
    FontPath "/usr/share/fonts/TTF"
    FontPath "/usr/share/fonts/Type1"
    EndSection
    Section "Module"
    Load "GLcore"
    Load "dbe"
    Load "dri"
    Load "extmod"
    Load "glx"
    Load "record"
    Load "xtrap"
    Load "freetype"
    Load "drm"
    EndSection
    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/input/mice"
    Option "ZAxisMapping" "4 5 6 7"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Monitor Vendor"
    ModelName "Monitor Model"
    HorizSync 30.0 - 130.0
    VertRefresh 50.0 - 100.0
    EndSection
    Section "Device"
    ### Available Driver options are:-
    ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
    ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
    ### [arg]: arg optional
    #Option "NoAccel" # [<bool>]
    #Option "SWcursor" # [<bool>]
    #Option "Dac6Bit" # [<bool>]
    #Option "Dac8Bit" # [<bool>]
    #Option "BusType" # [<str>]
    #Option "CPPIOMode" # [<bool>]
    #Option "CPusecTimeout" # <i>
    #Option "AGPMode" # <i>
    #Option "AGPFastWrite" # [<bool>]
    #Option "AGPSize" # <i>
    #Option "GARTSize" # <i>
    #Option "RingSize" # <i>
    #Option "BufferSize" # <i>
    #Option "EnableDepthMoves" # [<bool>]
    #Option "EnablePageFlip" # [<bool>]
    #Option "NoBackBuffer" # [<bool>]
    #Option "DMAForXv" # [<bool>]
    #Option "FBTexPercent" # <i>
    #Option "DepthBits" # <i>
    #Option "PCIAPERSize" # <i>
    #Option "AccelDFS" # [<bool>]
    #Option "DDCMode" # [<bool>]
    #Option "IgnoreEDID" # [<bool>]
    #Option "DisplayPriority" # [<str>]
    #Option "PanelSize" # [<str>]
    #Option "ForceMinDotClock" # <freq>
    #Option "ColorTiling" # [<bool>]
    #Option "VideoKey" # <i>
    #Option "RageTheatreCrystal" # <i>
    #Option "RageTheatreTunerPort" # <i>
    #Option "RageTheatreCompositePort" # <i>
    #Option "RageTheatreSVideoPort" # <i>
    #Option "TunerType" # <i>
    #Option "RageTheatreMicrocPath" # <str>
    #Option "RageTheatreMicrocType" # <str>
    #Option "ScalerWidth" # <i>
    #Option "RenderAccel" # [<bool>]
    #Option "SubPixelOrder" # [<str>]
    #Option "ShowCache" # [<bool>]
    #Option "DynamicClocks" # [<bool>]
    #Option "VGAAccess" # [<bool>]
    #Option "ReverseDDC" # [<bool>]
    #Option "LVDSProbePLL" # [<bool>]
    #Option "AccelMethod" # <str>
    #Option "DRI" # [<bool>]
    #Option "ConnectorTable" # <str>
    #Option "DefaultConnectorTable" # [<bool>]
    #Option "DefaultTMDSPLL" # [<bool>]
    #Option "TVDACLoadDetect" # [<bool>]
    #Option "ForceTVOut" # [<bool>]
    #Option "TVStandard" # <str>
    #Option "IgnoreLidStatus" # [<bool>]
    Identifier "Card0"
    Driver "radeon"
    VendorName "ATI Technologies Inc"
    BoardName "Radeon Mobility X1400"
    BusID "PCI:1:0:0"
    Option "XAANoOffscreenPixmaps" "true"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Card0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
    Viewport 0 0
    Depth 1
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 4
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 8
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 15
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 16
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 24
    Modes "1680x1050" "1440x900" "1280x800" "1024x768"
    EndSubSection
    EndSection
    Section "DRI"
    Group "video"
    Mode 0666
    EndSection

    It is very possible to have direct rendering on YOUR card (r5xx) with the radeon(ati) driver, but you need a lot of packages that are still in testing, and it is a somewhat daunting task to sort through everything.
    Most importantly, you need x-server 1.5 and mesa 7.1+
    The packages that you need & are newer than core/extra are (all can be had from testing, except libgl):
    mesa >= 7.1
    xf86-input-evdev 2.0.4
    xf86-video-ati >= 6.9.0
    xorg-server >= 1.4.99.906
    libgl >= 7.1  ** has to be built from a with ABS/pkgbuild, because you need to add r300 & radeon dri-drivers in the configure **
    I have an x1650 (rv535) and have been running the radeon driver WITH direct rendering since JULY, and the performance is very good. I can run compiz without skipping a beat (while playing WOP), 2800FPS on glxgears, and ** play video WITHOUT TEARING **!!
    Please read a lot of what's going on in this forum:
    http://www.phoronix.com/forums/forumdisplay.php?f=43 (open source ati/amd)
    I hope this gives you some hope that it can be done.
    Fight the good fight FOSS for ALL!
    BTW, the radeon(ati) driver is better than radeonhd for our cards!!!
    Last edited by Execute_Method (2008-11-19 00:19:30)

  • Flex 2 14 problem with keyboard

    Spoiler (Highlight to read)
    Hi all,
    I recently got this problem with my flex 2 14, the keys dont repeat when held down. For example when i press backspace, it deletes one letter only after holding down. My filter key is off and i even did a system restore, but the problem still persist. Any idea what is happening?

    Good day and welcome to the community.
    Does your spacebar have this symbol on it:
    If so, please try Fn+spacebar.
    Please note page 7 of the hardware manual:
    http://download.lenovo.com/consumer/mobiles_pub/le​novo_flex_2_14_flex_2_14d_flex_2_15_flex_2_15d_ug_​...
    says: "(on select models)".
    Regards.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Community Resources: Participation Rules • Images in posts • Search (Advanced) • Private Messaging
    PM requests for individual support are not answered. If a post solves your issue, please mark it so.
    X1C3 Helix X220 X301 X200T T61p T60p Y3P • T520 T420 T510 T400 R400 T61 Y2P Y13
    I am not a Lenovo employee.

Maybe you are looking for