All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jglfont.impl.ResourceLoaderImpl Maven / Gradle / Ivy

Go to download

Nifty GUI is a Java Library that supports the building of interactive user interfaces for games or similar applications. It utilizes OpenGL for rendering and it can be easily integrated into many rendering systems. The configuration of the GUI is stored in xml files with little supporting Java code. In short Nifty helps you to layout stuff, display it in a cool way and interact with it :)

The newest version!
package org.jglfont.impl;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import org.jglfont.spi.ResourceLoader;

public class ResourceLoaderImpl implements ResourceLoader {

  @Override
  public InputStream load(final String filename) {
    InputStream is = Thread.currentThread().getClass().getResourceAsStream("/" + filename);
    if (is == null) {
      File file = new File(filename);
      if (file.exists()) {
        try {
          is = new FileInputStream(file);
        } catch (FileNotFoundException ignore) {
        }
      }
    }
    return is;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy