Question: I want to set the size of my JButtons that are at the center of my screen to become larger but I can't seem to find how to do that using GridBagLayouts. 

Here is how it looks like :
![This is what it looks like](https://i.stack.imgur.com/BkjFs.png)

Here is my code : 

```
    //      Client
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.CENTER;
    c.gridy = 5;
    c.gridx = 5;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.insets = new Insets(10, 1, 1, 10);
    p.add(b[0], c);

    //      Server
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.CENTER;
    c.gridy = 10;
    c.gridx = 5;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.insets = new Insets(10, 1, 1, 10);
    p.add(b[1], c);

```

I want the buttons to take up a larger portion of the empty space around them.

Answer: 
You haven't specified any listening port in your server so the server listen on a random available port.

Try with this on server side

```
DatagramSocket socket = new DatagramSocket(9876);

```
The problem is that your server code doesn't specify a port - it will listen to a random available port, whereas the client is sending to 9876. To correct this, use:

```
DatagramSocket socket = new DatagramSocket(9876, InetAddress.getByName("localhost"));

```

(If you're on a linux system) I'd highly recommend using netstat to debug this kind of code:

```
netstat -ln | grep 9876

```

will tell you if a process is listening to port 9876.
Another useful tool is netcat, which can be used to send and receive TCP and UDP:

```
nc -u localhost 9876

```

allows you to send messages over UDP to the server.

In your client code, you also need to turn the received bytes back into a string to get meaningful output.