Pleas help - getting crazy here

Can anyone have a look at this code, please? I'm getting quite hairless here, as I can't get it to work.
The problem is that I can't get the values to and from the textfields.
Please drop a hint as to the obvious errors.
import java.awt.* ;
import javax.swing.* ;
import java.awt.event.* ;
class KassaApparat
              private JFrame ramme ;
     private Container container ;
     private JLabel beholdningLabel , beholdningText , kundeSnittLabel , handleSumLabel ;
     private JTextField kundeSnittFelt , handleSumFelt ;
     private JButton kundeSnittKnapp , handleKnapp ;
     private int ant_kunder = 0 ;
     private double beholdning = 1000 ;
     private double kundesnitt ;
     public void createAndShowGUI()
          ramme = new JFrame("KassaApparat") ;
          ramme.setSize(400,300) ;
          ramme.setDefaultLookAndFeelDecorated(true) ;
          ramme.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;     
          container = ramme.getContentPane() ;
          container.setLayout(new GridLayout(4,2)) ;
          beholdningLabel = new JLabel("Beholdning:") ;
          beholdningText = new JLabel("beholdning" + " kr.") ;
          beholdningText.setText(String.valueOf(beholdning)) ;
          kundeSnittLabel = new JLabel("Kundesnitt") ;
          handleSumLabel = new JLabel("Handlesum") ;
          kundeSnittFelt = new JTextField(10) ;
          handleSumFelt = new JTextField(10) ;
          kundeSnittKnapp = new JButton("Kundesnitt") ;
          handleKnapp = new JButton("Handle") ;
          // add action listener to buttons
          KnappeLytter lytter = new KnappeLytter() ;
          kundeSnittKnapp.addActionListener(lytter) ;
          handleKnapp.addActionListener(lytter) ;
          container.add(beholdningLabel) ;
          container.add(beholdningText) ;
          container.add(kundeSnittLabel) ;
          container.add(handleSumLabel) ;
          container.add(kundeSnittFelt) ;
          container.add(handleSumFelt) ;
          container.add(kundeSnittKnapp) ;
          container.add(handleKnapp) ;
                           ramme.pack() ;
          ramme.setVisible(true) ;
              // Method to deal with new transaction
     public void nyKunde()
          ant_kunder ++ ;
          System.out.println("nyKunde()") ; // test printing
          System.out.println(ant_kunder) ;  //
          // add the value in handleSumFelt to beholdning
                            beholdning = Double.parseDouble(handleSumFelt.getText()+beholdning) ;
                            System.out.println(nyHandel) ; // test printing
     // Method to calculate the average sum per customer
     public void kundeSnitt()
          System.out.println("kundeSnitt()") ;
          kundesnitt = beholdning/ant_kunder ;
          if (ant_kunder==0) {
               kundeSnittFelt.setText("Ingen kunder!") ;
          else {
               kundeSnittFelt.setText(kundesnitt) ;
// Actionlistener klasse
class KnappeLytter implements ActionListener
     KassaApparat kassaapparat = new KassaApparat() ;
     public void actionPerformed(ActionEvent klikk)
          try {
               if (klikk.getSource()==handleKnapp) {
                    //System.out.println("handleKnapp") ;
                    kassaapparat.nyKunde() ;
               if (klikk.getSource()==kundeSnittKnapp) {
                    //System.out.println("kundeSnittKnapp") ;
                    kassaapparat.kundeSnitt() ;
          } catch (NullPointerException e) {}
     } // ...end method actionPerformed
} // ...end class Knappelytter
// Diverklasse for kj�ring av klassen KassaApparat
class KassaApparat_Driver
     public static void main(String args[])
          KassaApparat kassaapparat = new KassaApparat() ;
          kassaapparat.createAndShowGUI() ;
} // .. end class KassaApparat_Driver

Can anyone have a look at this code, please? I'm
getting quite hairless here, as I can't get it to
work.Non-specific problems get no treatment (normally). Like I want to copy your code, compile it, run it, and figure out what "can't get it to work" really means, and solve it.
The problem is that I can't get the values to and from
the textfields.Well, that's somewhat specific, but still way off.

Similar Messages

  • ***lapi   getLocation Exception **please helpe***I am getting crazy*****

    Hi frnd
    Recently I am working on a location based project on mobile.I have search the net and found many source code for get BTS CELL ID and coordinates and all the source code have the same code.
    but when I install on mobile I get *{color:#ff0000}location Exception{color}*{color:#ff0000}...
    {color}I have search the net and every where and yet not found the solution, even i am using Nokia N71 which supports location based api.
    guys Really i am getting crazy, there should be a solution .... please help me
    there is a program in simbian "celltrack", It easily shows the BTS information,
    if any body has Idea please help me... thankssssssssss
    ...piece of code ....
    LocationProvider lp=*null*;
    Location location=*null*;
    try
    Criteria cr = new Criteria();
    //cr.setHorizontalAccuracy(1000);
    //cr.setVerticalAccuracy(1000);
    //cr.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);
    lp = LocationProvider.getInstance(cr);
    if(lp.getState()==1)
    message="provider! is valid" + "\n";
    //timeout
    {color:#ff0000}location = lp.getLocation(60); // Exception happens here
    ....{color}
    catch(LocationException e)
    btsInfo +="1:"+e.toString()+ "\n";

    Konapalli.Gopi wrote:
    i am using websphere application server to deploy the web application.
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
         class javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
         java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory
    I would guess
    com.ibm.websphere.ssl.protocol.SSLSocketFactoryis not on your classpath.

  • My daughter forgot the passcode to get into her ipod, can someone help us?

    My daughter forgot her pass code  to get into her ipod can someone tell us what to do to get into it?

    The manual can help you.  Click "SUpport" at the top of this page, then click "Manuals".
    It will tell you to restore the ipod.

  • Suddenly my imessage and facetime stop working both for iphone4 and ipad, i tried possible online solutions but it didn't work. Message such as "could not connect, check your network connection" etc... Help please am getting frustrated here....

    Suddenly my imessage and facetime stop working both for iphone4 and ipad, i tried possible online solutions but it didn't work. Message such as "could not connect, check your network connection" etc... Help please am getting frustrated here....

    Have you tried re-booting your WiFi router ?  It may seem OK on your PC, but a re-boot may help.

  • I just got a new iPhone 4S for my mum . I set it up on my iTunes and I install all her numbers in . Then I plug my phone in all my hints to got erased and I ended up getting all her contacts in my phone . Help I need my contacts back

    I just got a new iPhone 4S for my mum . I set it up on my iTunes and I install all her numbers in . Then I plug my phone in all my hints to got erased and I ended up getting all her contacts in my phone . Help I need my contacts back

    Read this link
    HT1495

  • Help.  My daughter backed up her iPod but copied all the info from my iPhone.  So now the iPod and iPhone have exactly the same things.  How do I get all her stuff back on her iPod?

    Help.  My daughter backed up her iPod but copied all the info from my iPhone.  So now the iPod and iPhone have exactly the same things.  How do I get all her stuff back on her iPod?

    Restore her iPod for the the backup of her iPod on the computer that she syncs with. For how to restore from backup see the restore topic of:
    iOS: How to back up

  • I only have 1 apple id, i plugged my wifes iphone 5 in to put some music on her phone, I now get all her text messages and when I text her, I also text myself, anyone help?

    I recently plugged my wife's iphone 5 into out Mac to update her music, ever since I get all her texts from friends and when I text her I also seem to text myself, what can i do to rectify this?

    Thanks very much, appreciate that, easy when you know how

  • Need help getting telnet access

    I am a little new to this and still going to college, I see you guys have really good support here. I bought a 3500XL switch off ebay to help me learn some cisco equipment as my instructor suggested it would be of great help getting ahead. I have done my basic configuration of the switch by setting up my switch ip address, enabling the vty 0 4 password and all but when i use SecureCRT to connect it gives me the error "The remote system refused the connection." and I cant seem to figure it out. I thought maybe the IP address I setup was conflicting somehow so I reassigned it to the last ip 192.168.100.254 instead of 192.168.100.1 and still no luck. I double checked and even setup the password from vty 0-15 just to make sure I had enough ports open to connect. Here is what my config looks like
    Current configuration:
    version 12.0
    no service pad
    service timestamps debug uptime
    service timestamps log uptime
    service password-encryption
    hostname Neo
    enable secret 5 (Left Out)
    username James password 7 (Left Out)
    ip subnet-zero
    ip domain-name (Left Out).com
    interface FastEthernet0/1
    interface FastEthernet0/2
    interface FastEthernet0/3
    interface FastEthernet0/4
    interface FastEthernet0/5
    interface FastEthernet0/6
    interface FastEthernet0/7
    interface FastEthernet0/8
    interface FastEthernet0/9
    interface FastEthernet0/10
    interface FastEthernet0/11
    interface FastEthernet0/12
    interface FastEthernet0/13
    interface FastEthernet0/14
    interface FastEthernet0/15
    interface FastEthernet0/16
    interface FastEthernet0/17
    interface FastEthernet0/18
    interface FastEthernet0/19
    interface FastEthernet0/20
    interface FastEthernet0/21
    interface FastEthernet0/22
    interface FastEthernet0/23
    interface FastEthernet0/24
    interface FastEthernet0/25
    interface FastEthernet0/26
    interface FastEthernet0/27
    interface FastEthernet0/28
    interface FastEthernet0/29
    interface FastEthernet0/30
    interface FastEthernet0/31
    interface FastEthernet0/32
    interface FastEthernet0/33
    interface FastEthernet0/34
    interface FastEthernet0/35
    interface FastEthernet0/36
    interface FastEthernet0/37
    interface FastEthernet0/38
    interface FastEthernet0/39
    interface FastEthernet0/40
    interface FastEthernet0/41
    interface FastEthernet0/42
    interface FastEthernet0/43
    interface FastEthernet0/44
    interface FastEthernet0/45
    interface FastEthernet0/46
    interface FastEthernet0/47
    interface FastEthernet0/48
    interface GigabitEthernet0/1
    interface GigabitEthernet0/2
    interface VLAN1
    ip address 192.168.100.254 255.255.255.0
    no ip directed-broadcast
    no ip route-cache
    ip default-gateway (Left Out)
    snmp-server engineID local 0000000902000009B7473E00
    snmp-server community private RW
    snmp-server community public RO
    banner motd ^C
    DO NOT LOG ON UNLESS YOU HAVE BEEN PERMITTED BY THE OWNER
    ^C
    line con 0
    password 7 (Left Out)
    login
    transport input none
    stopbits 1
    line vty 0 4
    password 7 (Left Out)
    login
    line vty 5 15
    login
    end

    I have my default gateway setup but it is setup for my access to the internet, to access it right now i use a rollover cable but I am wanting to use an ethernet cable from my pc to the switch to connect. I can ping the switch from DOS fine and when I ping my pc it pings perfect too. Im sure its something simple I looked over but its gonna drive me crazy till I get it :-)
    the pc is on a network of 192.168.100.2 subnet 255.255.255.0
    the switch is on a network of 192.168.100.254  subnet 255.255.255.0
    my router is on a network of 192.168.100.1  subnet 255.255.255.0

  • What burns me up about the Pixi (sprint)-If you can, help me out here

    This is a half rant half 'I hope someone can help me out here with something I'm doing wrong' post, because my experience with this phone makes me want to smash it into a developers face. (Try not to take offence, it's just a thought, I am actually physically stuck with this phone)
    Messaging:
    No time stamps for messaging? With my pending civil court case, it'd be nice to have this rudimentary gem that's been on every phone since 1998. But let's be honest...it's just nice to know when what was said. Awesome that I can save every message for 3 months. Blows that I can't figure out when it was sent.
    Missed Calls:
    OK being that I actually like to think of my pixi as a phone first, then a "computer", I'd love to be able to sift through my missed calls on the red missed call alert bar. Since I'm too much of a, "let's get this done now" guy, I hate loading an app to get to my missed calls off of a little button on an already small interface. If I don't want to load the app, I have to click on the missed call alert bar, make my phone dial the number, end the call immediately, and continue untill I go through all of my missed calls (Yea I've done it before, I hate loading apps that bad). How about if you drag down on the missed call alert bar, it pulls the top one off and reveals the PREVIOUS missed call. (Holy ----! Am I a genius, or am I just someone who actually used this phone for more than 3 minutes?) Hopefully I can just sift through my calls on the messed call's red alert ball, but I've tried it every which way and I don't think I can...Help me out here.
    SMS through missed call icon also only works when it wants to (software issue)
    Airplane Mode: I accidentally put my phone into Airplane mode like twice a week. This blocks all calls and you just don't even know it's on until you notice the plane on the screen. Why is it so easy? Does palm not realize the consumer base that this phone makes it to probably uses an airplane once every year? I mean I've never even been on a plane and I got suckered into this thing, yet I feel like I should be able to have enough frequent flier miles to go around the world 6 times accoroding to how much I accidentally turn on Airplane Mode. Wth? Whose idea was that?
    Facebook syncing: Seriously, who in their right mind wants every single one of heir FB friends on their phones? Certainly not me. Sorry I don't need to talk to all 400 people I've added from school. Best part is, once the syncing deed is done, you can't stop it. That's just brilliant. You spend an hour sycing your phone to FB, just to reset your contacts.
    Ringtones: Text messaging ringtones literally plays for about 10 seconds and stop. Who on gods green earth told you that it'd be Ok to play any ringtone for like 10 seconds? Seriously...? PLEASE tell me I can change this. I can't even get through the intro of a song in 10 seconds. That's just great. May I add my ringer just seems to have shut off today. Why and when, I don't know. But my ringer is on, turned up, and I'm just getting text messages and calls as I type this with no sounds. lol Seriously. I'm not even kidding. I don't know how to make the alert sound. That's absurd. lol Like really I'm laughing at how pitiful it is that this is what my phone does so I'll just type another lol to further express how much of a joke this phone is to me. lol
    Contact Reminder: Now I'm not sure what I'm doing. But pretty often, when trying to hurriedly dial a number, I accidentally hit contact reminder, load a new app. Meanwhile I have to get rid of the app and get to my phone. Now here's the kicker...I did it "hurriedly"(yea I make up words when I need to) which means I'm in a rush. Thx for not helping whatever situation I'd be in/have been in, Palm...You're supposed to work with me, not against me. :\
    Calendar: Awesome app. I actually bought this phone for its uses here. But I'm not sure if it's just me, or the phone, but I can't even have this thing remind me to take out the trash every WEDNESDAY. From what I can tell, I can only do reoccuring reminders by date, and not by day. Seriously? If I'm not missing something here and that is the case, you've completely failed your name Palm. Just saying, I mean jeez...
    Youtube: Now really. You almost outdid yourself with the youtube app. You could have made me forget of all of this phones shortcomings had you not just screwed up here too. Now I don't know who you have agreements with, but since I can't actually get the same vids I'd normally get on the computer (for example, music videos) to come up in my search, you've essentially turned youtube, "you"sless. Now that actually takes more effort in screwing up than not. This thing right here just makes me think you're trying to get me mad.
    Small keys:Won't even touch on that subject, I should have noticed from the get go. I knew it, thought I'd get used to it, but no. They are just too small and that's that. Not even blaming palm for this one.
    Palm taught me 2 things with this phone.
    1: Never buy from palm again, we just don't seem to agree on what a phone should do. I had great expectations in the Palm name, only to find out that I'm going to be enraged by the phone daily.
    2olidification in the notion that "if it's too good to be true, it probably is." Because that's exactly what I got out of the experience with this phone.
    So unless someone can set my problems straight, I'm going to be looking foward to my next upgrade like it's the last day of school for a 12 year old. At least life won't continue speeding by as long as I have this thing. I guess that's one bonus. :\
    The worst part is this is all that I can think of sitting here. I can probably edit this throughout any given day to make it into a small book. Which I would try to publish if I'm not flat out wrong about at least half of these "problems". Because if so...this phone should have never hit the market. No offense. Like I said, I actually have to use this phone. Palm just gets more money out of it.
    Thx if you read, and thx if you help me out. I hope someone tells me what I'm doing wrong and makes me look like a complete idiot. This is your chance, defend palm!
    Post relates to: Pixi p120eww (Sprint)

    Hi ChrisBell,
    my Pixi shows me the missed calls in a list of its own? I don't have many, so maybe I'm missing something. But I agree with your half-ranting to some degree. As a long-time Palm-user (my last phone was a Treo 680, terrible form factor, good UI), I am really disappointed with the standard software on this phone. Memos and Tasks, which AFAIK were there and useful even on the first Newton's, have regressed beyond the point of usefulness now (solution: Toodledo and Done!, at least for now).
    But ChrisBell: if you feel up for it, you could start tinkering. Many people love these phones so much they have started developing patches to solve the obvious problems skimmed over by developers. Try looking up "webosquickinstall" and "preware", and you will find over 300 patches and a lot of free software to help you out. I am not a computer wizard myself, but I am not scared of them either, and I have been able to make good use of all these extras made available by the community.
    just a thought, might help you out on a few of your half-rants

  • TS1538 i need help because i need help getting my ipod touch to connect to windows vista and

    i need help getting my ipod touch to connect to windows because it keeps saying udb device not recognized and i tr\]ied restarting the settings!!!!!

    Have you tried here:
    iOS: Device not recognized in iTunes for Windows

  • Screen no longer works, help getting set up with external LCD?

    So my Titanium Macbook Pro's screen went out yesterday and it's no longer covered so I've been trying to figure out how to get it to work with an external LCD monitor.
    I can get it to boot up, and I can even get it to open itunes via Spotlight and hit play and hear music, so I know all else is (hopefully) fine.
    The monitor I have is an "Acer LCD Monitor AL1916W A" and I have the adaptor going out of my MBP to a VGA cord that then connects to the Acer.
    I read this page to get the idea to do this: http://osxdaily.com/2010/12/21/broken-macbook-pro-screen-turn-it-into-a-desktop- mac/
    But I cannot get the Acer screen to recognize the MBP and show an image. The Acer powers up and shows it's logo but then says 'no signal'.
    I tried to blindly Spotlight > System Preferences > Displays but can't get anywhere from there. I tried to restart it and close the screen but no-go.
    Help?

    Answered here: http://discussions.apple.com/thread.jspa?threadID=2725868&tstart=0

  • Hallo, my Firefox browser wont load youtube for some reason, the explorer will. I have tries to change the proxy setings as the firefox help center suggested, but to no avail. Also no updates were installed on firefox that I'm aware of. pleas help me.

    Hallo,
    For some reason firefox has stopped loading the youtube site for me. I can watch videos other people uploaded to facebook for example, but cant get into the site. the explorer will load the site, so I've tried changing the proxy settings in my firefox as recommended in the help center, but to no avail. Also there was no update installed that I'm aware of, getting to youtube through any link will simply give me an error message saying the connection was reset while the page was loading.
    pleas help me.

    I had trouble with youtube and cleared all history and cache. This cleared up the problem(s).

  • Tree Component ... getting crazy !

    So tree component is terrible , every thing is gone , trying
    all day to get directly to tree component and no result ,and there
    is no basic explanation and no examples , i tried to search in Flex
    Help Content , but I get more Cold Fusion tree help than Flex tree
    .. spend 800 dollar for flex and get CFHelp , I don’t think
    is good idea , so pleas help me , how can i add simple tree node
    with out XML , I hate XML , and i know some how we can work with
    Tree component directly though ITreeDataDescriptor , but how ..?
    In As2 it was simple and easy, now how to do this I
    don’t know and I am not only one!
    I am not a specialist in Action Script but in AS2 I never had
    a problem, and if I did, we have a lot of documentation about AS2
    and examples, but Flex trying to sell a product that not supports
    any examples and documentation... Write in search content
    ‘tree’ and you get cf tree examples and structures, but
    I don’t need cftree information, I need flex tree exemplas,
    but there is few... Working with flex all week I get more tired and
    depressed.. Any thing I trying to do is going wrong, AS2 is not
    there any more and I understand that I have to learn AS3 from
    beginning to understand it... I hate it!!!!!!
    Flex - Rich Application for users and Rich work for
    Developers!

    Eddy, chill out man.
    How can you say, "I hate XML," and really even try to learn
    Flex? Flex is based on XML, MXML is XML, any services you call
    (HTTP or WEB) are XML. I think it's time for change and time you
    picked up XML. It's actually very, very simple.
    You don't have to learn AS3 from the ground up. There are a
    lot of similarities between AS2 and AS3.
    You just need to write a simple function which goes through
    the array and converts it to xml. While I could program that for
    you, I think you could probably figure it out yourself.
    But why even bother? Using an XMLList is just as easy.
    Behold:
    <mx:XMLList id="treeData">
    <node label="Mail Box">
    <node label="Inbox">
    <node label="Marketing"/>
    <node label="Product Management"/>
    <node label="Personal"/>
    </node>
    <node label="Outbox">
    <node label="Professional"/>
    <node label="Personal"/>
    </node>
    <node label="Spam"/>
    <node label="Sent"/>
    </node>
    </mx:XMLList>
    XML is composed of parents and children. You can do much more
    with XML than you can with plain old arrays, plus, when's the last
    time you saw a 10-tiered multi-dimensional array? It's not possible
    to do something like that without XML.
    Over and out - Taka.

  • My daughter has somehow figured out how to register for her own Apple ID but is very underage. She is not giving me the correct info for me to get into her email. She has downloaded some apps that I would not allow. How can I recover her Apple ID info?

    My daughter has somehow figured out how to register for her own Apple ID but she is very underage. She is not giving me the correct info for me to get into her email. She has downloaded some apps that I would not allow. How can I recover her Apple ID info?

    No it's not stealing. They have an allowance that you can share with so many computers/devices. You'll have to authorize her computer to play/use anything bought on your acct. You can do this under the Store menu at top when iTunes is open on her computer.
    As far as getting it all on her computer....I think but I am not sure (because I don't use the feature) but I think if you turn on Home Sharing in iTunes it may copy the music to her computer. I don't know maybe it just streams it. If nothing else you can sign into your acct on her computer and download it all to her computer from the cloud. Not sure exactly how to go about that, I haven't had to do that yet. I wonder if once you authorize her computer and then set it up for automatic downloads (under Edit>Preferences>Store) if everything would download. Sorry I'm not much help on that.

  • Curve 9300 scroll up seems to get crazy after upgrading to 6.0

    since upgraded to 6.0 a day after while chating on BBM my 9300 get crazy and scroll up all the time . sometimes on any screen for writing smses or checking e-mails. Can we fix this are do I have to reverse to original O.S version?

    Hi fdambrozy
    To clarify, does your BlackBerry tend to scroll on its own or is it very irratic when scrolling?
    Thanks
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

Maybe you are looking for

  • 103 to 105 report

    do we have any transaction code to check the open 105 for the 103. (i dont want we103 or we105 selection para meter in me2l/m/n..etc i wan the same in reprt. GRN number of 103               103 release (105) 50000101                    50000103 50000

  • Java all messed up after SL install

    I'm having trouble with Java on both Firefox and Safari after a snow leopard install, and cannot find anything out about it online to fix it. Firefox This issue isn't causing me as many issues. When I log into WebVista (a board for the University of

  • Issue in Mapping

    Hi, Theres some thing going wrong with my context mapping.can you guys suggest where i am going wrong.. My source side structure: ZBillHeader(1:1)---- Billno (0:1) ZParty(0:unbound)---- Company(0:1) My target field Details(0:unboun)---- Billdetails(0

  • Lost contacts in iphone5

    lost part of my contacts, some help....

  • Cover Flow with PSDs (Photoshop Documents)

    Hi, I have a question. When you're saving Photoshop PSD files out of CS3 in Leopard, should you include the File Previews in the file or not? It used to be that you had to embed the little Icon Previews in the files themselves, but I believe Leopard