Terminal not accessing .png files from Eclipse Project [message #1020324] |
Sun, 17 March 2013 23:14 |
David Taylor Messages: 1 Registered: March 2013 |
Junior Member |
|
|
The project runs fine in Eclipse, but when I try to take the files and run it through Terminal, it seems like it is not accessing the .png files. I don't know what to do.
Here is my main class:
import javax.swing.*;
import java.awt.*;
public class Frame extends JFrame {
public static String title = "Tower Defense Alpha";
public static Dimension size = new Dimension(700, 550);
public Frame() {
setTitle(title);
setSize(size);
setResizable(false);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
init();
}
public void init(){
setLayout(new GridLayout(1,1,0,0));
Screen screen = new Screen(this);
add(screen);
setVisible(true);
}
public static void main(String args[]){
Frame frame = new Frame();
}
}
Here is how I am accessing the .png files in Eclipse, which isn't working in Terminal:
for (int i=0; i<tileset_ground.length; i++) {
tileset_ground[i] = new ImageIcon("res/tileset_ground.png").getImage();
tileset_ground[i] = createImage(new FilteredImageSource(tileset_ground[i].getSource(),
new CropImageFilter(0, 26*i, 26, 26)));
}
|
|
|
Re: Terminal not accessing .png files from Eclipse Project [message #1020759 is a reply to message #1020324] |
Mon, 18 March 2013 21:49 |
Heiner Westphal Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Hello David,
I cannot quite imagine your setup.
What kind of terminal are you running?
XTerm on an X server? PuTTy or some other ssh client?
Or is it a local terminal on a linux box, or on Windows?
And I cannot see if this is related to TPTP in any way.
Could you shed some more light on this?
Thanks,
Heiner
Am 18.03.2013 19:18, schrieb David Taylor:
> The project runs fine in Eclipse, but when I try to take the files and
> run it through Terminal, it seems like it is not accessing the .png
> files. I don't know what to do.
>
> Here is my main class:
>
> import javax.swing.*;
> import java.awt.*;
>
> public class Frame extends JFrame {
> public static String title = "Tower Defense Alpha";
> public static Dimension size = new Dimension(700, 550);
>
>
> public Frame() {
> setTitle(title);
> setSize(size);
> setResizable(false);
> setLocationRelativeTo(null);
> setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>
> init();
>
> }
>
> public void init(){
>
> setLayout(new GridLayout(1,1,0,0));
>
> Screen screen = new Screen(this);
> add(screen);
>
> setVisible(true);
>
> }
>
> public static void main(String args[]){
> Frame frame = new Frame();
>
>
> }
> }
>
>
> Here is how I am accessing the .png files in Eclipse, which isn't
> working in Terminal:
>
> for (int i=0; i<tileset_ground.length; i++) {
> tileset_ground[i] = new
> ImageIcon("res/tileset_ground.png").getImage();
> tileset_ground[i] = createImage(new
> FilteredImageSource(tileset_ground[i].getSource(),
> new CropImageFilter(0,
> 26*i, 26, 26)));
> }
|
|
|
Powered by
FUDForum. Page generated in 0.03835 seconds