|
Author |
Topic: .class FULLSCREEN ? (Read 1348 times) |
|
asli
|
.class FULLSCREEN ?
« on: Jul 31st, 2004, 4:48pm » |
|
hi! ??does anybody has an idea how i can RUN "mysketch.class" FULLSCREEN (which is created if i unjar "mysketch.jar")?? Im changing some data-information (i.e mytext.txt, mypictures.gif) dynamically, while the sketch is running. That's why i have to run "mysketch.class" instead of "mysketch.jar". How i run "mysketch.class" 480x640: 1. by creating an html file & saving it to the same directory as "mysketch.html": <html> <body> <applet code="mysketch.class" height="480" width="640"> </applet> </body> </html> 2. by starting cmd & changing to the directory & writing: appletviewer.exe mysketch.html i'm on: windows XP java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4 Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) *macosX suggestions are also welcome
|
|
|
|
asli
|
Re: .class FULLSCREEN ?
« Reply #2 on: Aug 1st, 2004, 1:05pm » |
|
hi fjen! thanx for your reply! yes i've read min 3times, +1 more time again. sorry, maybe my problem is not clearly defined: i actually don't have any problems to run the JAR files FULLSCREEN. my problem is that; i have to run the .CLASS (which exists by unjaring) FULLSCREEN. maybe there is a method to use BApplet also to run the CLASS files fullscreen? but i couldn't find any. so, i unjar "mysketch.jar". and i run the "mysketch.class" implemented in a html file. but i can't run it fullscreen. this is the part of the code: //----------- Font information :::::::::::::::::::::::::::::::::::::::::::::::::::: String [] TempWorts; String wort; void setup() { size(640, 480); fill(255); stroke(0); //----------- Constructs a new font and makes this font active :::::::::::::: BFont fontA = loadFont("Arial.vlw"); textFont(fontA, 18 ); } void loop() { background(255); //---------- Loads the Texts dynamically from the "test.txt" file ::::::::::::: TempWorts = loadStrings("test.txt"); wort = TempWorts[0]; //---------- Loads the actual text output without any deformation ::::::::::: //textSize(80); text(wort, 15, 465); }
|
|
|
|
fjen
|
Re: .class FULLSCREEN ?
« Reply #3 on: Aug 1st, 2004, 5:34pm » |
|
hi again, there is no need for you to unjar things ... just remove the test.txt and the .gif from your data folder before exporting to web (then they are not included). then place them next to the .jar file (inside the applet folder) and anything should be working fine. Quote: the reference is a little unclear there ... (unsigned) applets can only read from the same server they are running on. if you are running (as application) on a local machine then you should be able to read from nearly anywhere on that machine (depending on the local user permissions).
|
« Last Edit: Aug 2nd, 2004, 8:17am by fjen » |
|
|
|
|
fry
|
Re: .class FULLSCREEN ?
« Reply #4 on: Aug 1st, 2004, 6:23pm » |
|
loadStrings will read from inside the .jar.. an applet running locally (yet still inside a browser) will often have difficulties getting to other adjacent files (outside the jar) because of the default security permissions. the problem is that your web browser sees that the applet is trying to access a local file (even if it's inside the codebase or documentbase) and won't let you do it. however, things inside the jar should be accessible even in this situation.
|
|
|
|
fjen
|
Re: .class FULLSCREEN ?
« Reply #5 on: Aug 2nd, 2004, 8:30am » |
|
right, i meant running locally as an application ... running in a browser (locally or remote) will put you in the sandbox. but still, once you need to read something that is due to changes (dynamic textfile, webcam images) the easiest, savest place to read it from is next to the .jar or .class files, i guess ...
|
|
|
|
asli
|
Re: .class FULLSCREEN ?
« Reply #6 on: Aug 2nd, 2004, 2:18pm » |
|
yeap, it is working! great! but i had to give the absolute path for loadStrings. the difficulty is that: loadImage is not working with an absolute path! It works by activating the Personal Web Sharing and placing it to the Sites folder on macosx. a strange way to do it. so, wating for 70: http://processing.org/discourse/yabb/board_Syntax_action_displa_y_num_1083152603.html Does it work for you fjen, without giving the absolute path, just placing them next to the jar Things inside the jar are accessible but it recognizes the changes only after restarting the sketch! thank you!
|
|
|
|
fjen
|
Re: .class FULLSCREEN ?
« Reply #7 on: Aug 2nd, 2004, 11:22pm » |
|
hi asli, hmm ... don't really know where your problem resides. my setup is: os-x, java 1.4+, processing 68. running as an applet localy in a browser or appletviewer (no personal web sharing / apache involved), i can read images ( loadImage("image.jpg"); ) and read strings ( loadString("sometext.txt"); ) from next to the .jar (not inside, see folder below) ... same for running as fullscreen application. folder: - somesketch.jar - index.html - sometext.txt - image.jpg [ sidenote: there is no need for you to use the fullscreen stuff if you're running in a browser (it's all in the main method, so it won't be called ...). running fullscreen in a browser would be a thing of setting the size of the applet and some javascript to set the windowsize in the browser .. ] maybe you could describe your setup a little more ... things inside a .jar (is a zip-file) are readable ... i don't think you can (easily) save into it. ... or modify it's contents from outside.
|
« Last Edit: Aug 2nd, 2004, 11:26pm by fjen » |
|
|
|
|
asli
|
Re: .class FULLSCREEN ?
« Reply #8 on: Aug 3rd, 2004, 2:32pm » |
|
hiiiiii fjen! everything is working fine for me. it was a good tip thank you. i actually need it just for loadString("text.txt"). & loadImage just curiosity no, no: i'm NOT running it in a browser. it runs fine as a FULLSCREEN*APPLICATION. my setup: Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-117.1) Java HotSpot(TM) Client VM (build 1.4.2-34, mixed mode) Macos10.3.3 processing 68 ************************************************************************ *********************** String [] TempWort; String wort; BImage bild; byte[] byt; void setup() { size(640, 480); fill(255); stroke(0); //----------- Constructs a new font and makes this font active ::::::::::::::::::::::::::::::::::: BFont fontA = loadFont("Arial.vlw"); textFont(fontA, 18 ); } void loop() { background(255); //---------- Loads the Texts dynamically from the "test.txt" file ::::::::::::::::::::: TempWort = loadStrings("test.txt"); wort = TempWort[0]; //---------- Loads the actual text output without any deformation ::::::::::::::::::::::::::::::::::::::::: fill(0, 0, 0); text(wort, 15, 465); //---------- DOESN'T load the images from the applet folder :::::::::::::::::::::::::::::::::::::::: bild = loadImage("0000.gif"); image (bild, 50, 50); //---------- Reads the binary data ::::::::::::::::::::::::::::::::::::::::: byt = loadBytes("0000.raw"); } ************************************************************************ *********************** things inside a .jar are updateable:::::: http://java.sun.com/docs/books/tutorial/jar/basics/update.html heeeeeey thanx a lot!
|
|
|
|
|