Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.swing.SwingConstants;

public class Main {
    public static int asHAlign(String val) {
        if (val.equals("leading"))
            return SwingConstants.LEADING;
        else if (val.equals("trailing"))
            return SwingConstants.TRAILING;
        else if (val.equals("left"))
            return SwingConstants.LEFT;
        else if (val.equals("right"))
            return SwingConstants.RIGHT;
        else if (val.equals("center"))
            return SwingConstants.CENTER;

        assert false;
        return -1;
    }
}