Advertise Here

Author Topic: Void troubles....  (Read 4967 times)

0 Members and 1 Guest are viewing this topic.

Offline Jish

  • SMF For Free Member
  • *
  • Posts: 71
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Void troubles....
« on: September 23, 2009, 06:53:54 pm »
Forum Url: www.rakdra.com/forum/
Hello..

I'm having trouble with this god damn void..
Code: [Select]
public void World2(){
 World2.addActionListener (new ActionListener() {
@Override
public void actionPerformed(ActionEvent e);
//{
int newPort; = "5555";
//set current port to newPort, depends on your client
}
}
}
I'm trying to make it change the port the client is set on when a button is click in the Gui which loads this void..
Code: [Select]
if (cmd.equalsIgnoreCase("World 2"))
            {
World2();
System.out.println("Port = " +port);

            }
is the button..These are in two different classes..

Please, I need help with this ASAP!!

i get these errors..
Quote from: Compiler
client.java:13964: illegal start of type
                int newPort; = "5555";
                             ^
client.java:13964: ';' expected
                int newPort; = "5555";
                              ^
client.java:13966: ')' expected
        }
         ^
3 errors
Press any key to continue . . .


www.rakdra.com Join today! New growing rsps

Offline Mdog

  • SMF For Free Member
  • *
  • Posts: 48
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Void troubles....
« Reply #1 on: October 15, 2009, 09:46:48 pm »
I know this thread is dead (like this entire section sadly), but I'll answer your question anyways.  On the line
Code: [Select]
World2.addActionListener (new ActionListener() {you are missing a ")" after ActionListener().  So your fixed code would be this
Code: [Select]
World2.addActionListener (new ActionListener()) {I hope you have already figured this out by now, but in case you didn't, have fun.

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1261 Views
Last post April 08, 2007, 10:19:32 am
by Nutz
21 Replies
3417 Views
Last post September 20, 2007, 12:17:24 am
by mom
1 Replies
1232 Views
Last post November 26, 2007, 10:27:37 am
by simply sibyl
4 Replies
6360 Views
Last post August 26, 2009, 05:37:32 pm
by Games
1 Replies
1319 Views
Last post July 14, 2010, 04:09:09 pm
by Seldom Fail