Swap nodes in a binary tree
Current solution
There's nothing really wrong with your current solution.  You build the tree, do the swapping and then do the inorder traversal.  Each step is implemented in a simple way and there isn't much excess code.  However, since you asked about doing it in less code, I will show you two ways to dramatically reduce your code.
You don't need to build a second tree
If you think about it, after you have read in the tree into your array called leafs, you already have a complete tree structure.  You don't need to build a second tree with nodes, left/right children, etc.  You can just use the array as your tree representation.  Therefore, all of your TreeNode code is unnecessary.
You can print the inorder traversal during the swap
Right now, you run the swap() function to swap the requested nodes, and then run the inorder() function to print the nodes in the swapped tree.  Since those are the only two operations you need to do, you can just print the traversal while swapping instead of doing two passes.
Revised solution
Here is what your code would look like after making the above two changes.  Note that I modified the array to be 1-based because the problem wanted the root to be node 1.
import java.util.Scanner;

public class Solution {
    public static final int ROOT_NODE = 1;

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        final int N = s.nextInt();
        int[][] tree = new int[N+ROOT_NODE][2];

        for (int i = ROOT_NODE; i &lt; N+ROOT_NODE; i++) {
            for (int j = 0; j &lt; 2; j++) {
                tree[i][j] = s.nextInt();
            }
        }

        int numDepths = s.nextInt();
        for (int i = 0; i &lt; numDepths; i++) {
            swap(tree, ROOT_NODE, s.nextInt(), 1);
            System.out.println();
        }
    }

    public static void swap(int [][] tree, int node, int targetDepth,
            int depth) {
        if(node == -1) return;

        if(depth % targetDepth == 0) {
            int temp = tree[node][0];
            tree[node][0] = tree[node][1];
            tree[node][1] = temp;
        }
        swap(tree, tree[node][0], targetDepth, depth+1);
        System.out.print(Integer.toString(node) + &quot; &quot;);
        swap(tree, tree[node][1], targetDepth, depth+1);
    }
}