Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.awt.Component;

public class Main {
    static int getY(final Component component) {
        final int y = component.getY();
        final Component parent = component.getParent();
        if (parent == null) {
            return y;
        } else {
            return y + getY(parent);
        }
    }
}