Results 1 to 3 of 3
  1. #1
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default [newbie] messed up code

    I have a bit of a problem getting this code to compile, and, well, what I noted was:

    1. It seems to use a class named PasswordChooser, however the code 'implements' the class rather than 'extending' it. Is there something I should know?

    2. There seems to be some bracketing problem, however, I can't figure out whether I have done something wrong actually (DataExchangeFrame.java L.50 to L.70).

    3. Uploaded code here.

    :confused:

    which means

    i don't know...


    NOTE 1: I'm running Eclipse 3.4.2 on a Windows Server 2008 64 bit machine.
    Microsoft Windows [Version 6.0.6001]
    Copyright (c) 2006 Microsoft Corporation. All rights reserved.

    C:\Users\Administrator>java -version
    java version "1.6.0_13"
    Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
    Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

    NOTE 2: This will take you a while.
    Last edited by jon80; 05-30-2009 at 02:44 PM.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    Java Code:
    C:\jexp\jon>javac *.java
    DataExchangeFrame.java:46: '{' expected
        private class ConnectAction implements PasswordChooser();
                                                              ^
    1 error
    This part is goofy: PasswordChooser();
    PasswordChooser is a class, not an interface. You can extend classes and you can implement interfaces.
    Perhaps you meant to implement the ActionListener interface.
    Change this
    Java Code:
        private class ConnectAction implements PasswordChooser();
        {
            public void actionPerformed(ActionEvent event)
            {
                ...
            }
        }
    to this
    Java Code:
        private class ConnectAction implements ActionListener
        {
            public void actionPerformed(ActionEvent event)
            {
                ...
            }
        }
    When I straightened this up and re–compiled I got 11 errors in the console, all for the PasswordChooser class.

  3. #3
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default

    Thanks, that was pretty useful :) There are in fact a bit of compilation problems, hopefully I'll be able to fix them someday.

    WARNING: Don't buy a book that doesn't have downloadable code samples, you'll have a hard time learning Java, although some might argue that's a good way to learn to troubleshoot :)

Similar Threads

  1. Non functional radio buttons and messed up array
    By flameofSuzaku in forum New To Java
    Replies: 2
    Last Post: 01-10-2011, 06:38 PM
  2. Newbie Help
    By mattkid in forum New To Java
    Replies: 4
    Last Post: 03-25-2009, 05:55 AM
  3. I must be seriously messed up...
    By jpnym15 in forum New To Java
    Replies: 2
    Last Post: 11-16-2008, 08:20 PM
  4. newbie newbie newbie
    By krislogy in forum New To Java
    Replies: 9
    Last Post: 08-15-2008, 01:28 AM
  5. Replies: 1
    Last Post: 04-26-2007, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •