|
Author |
Topic: BApplet fullscreen modification (Read 12528 times) |
|
michael05
|
BApplet fullscreen modification
« on: Jan 15th, 2004, 1:37am » |
|
here is a modification of the BApplet class. it resizes the screen to the width and height of the applet and enables fullscreen mode. i think jvm 1.4+ is needed to run. i only tested it under os x 10.3 and java 1.4.1. it works pretty good. place the BApplet.class beneath your jar in the applet folder and start it with: java -cp ./:projectName.jar BAppletFS projectName source code: http://dev.m05.de/p5/BAppletFS the minimum resolution is 640x480 for the most cards. i did not test smaller resolutions. use apple+q to quit the application (ctrl-q or alt-f4). there could be a fullscreen centered presentation mode without scaling, too. michael05
|
« Last Edit: Jan 15th, 2004, 12:37pm by michael05 » |
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
c Guest
|
Re: BApplet fullscreen modification
« Reply #1 on: Jan 29th, 2004, 2:16am » |
|
hi michael, could you be so kind and explain how to implement your classes by code? something like a ultracompressed documentation for lazy, non-java-professional fh-students :# good luck for your presentation, christian
|
|
|
|
michael05
|
Re: BApplet fullscreen modification
« Reply #2 on: Jan 30th, 2004, 7:59pm » |
|
hello christian you dont have to modify anything in your applet code. just copy the two BAppletFS class files in the same folder as your applets jar file. then you enter the following line in the terminal: (browse to your applets folder) java -cp ./:projectName.jar BAppletFS projectName you can write a batch file (.bat) in windows, too.
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
c Guest
|
Re: BApplet fullscreen modification
« Reply #3 on: Jan 30th, 2004, 10:05pm » |
|
hi michael, thank you for help, i think this will be enough ! good luck christian
|
|
|
|
mKoser
|
Re: BApplet fullscreen modification
« Reply #4 on: Jan 30th, 2004, 11:32pm » |
|
i just tried it on my PC, but i get this error thrown at me: Code: Exception in thread "main" java.lang.NoClassDefFoundError: BAppletFS |
| i made a simple piece of code to test it: Code: int bg = 6; int inc = 4; void setup(){ size(640, 480); } void loop(){ bg += inc; if(bg >= 250){ inc = -inc; }else if(bg <= 5){ inc = -inc; } background(bg); } |
| - exported that as an applet. - created a folder in the root of my c-drive (to avoid browse-typing the long way to my processing-folder) - copied the files from your server there - typed java -cp ./:projectName.jar BAppletFS projectName - got the error message (i've got java 1.4.2 installed on my winXP) did i miss out on something? cheers, + mikkel
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
michael05
|
Re: BApplet fullscreen modification
« Reply #5 on: Jan 31st, 2004, 3:18pm » |
|
your code works fullscreen on os x. i think the problem ist th "./" in the command. it says to include the current folder and its classes to classpath. i dont know whats the pendant on windows. sorry. perhaps you can search in this forum for classpath varibles on windows: http://forum.java.sun.com/ michael
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
michael05
|
Re: BApplet fullscreen modification
« Reply #6 on: Jan 31st, 2004, 4:15pm » |
|
there is a workaround. it would be better to pack the two BAppletFS classes in one jar file. call it BAppletFS.jar. then this command should work: java -cp BAppletFS.jar:projectName.jar BAppletFS projectName heres the jar: http://dev.m05.de/p5/BAppletFS/ hope it works now..
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
mKoser
|
Re: BApplet fullscreen modification
« Reply #7 on: Jan 31st, 2004, 4:26pm » |
|
thanks for helping... hmmm: Code: C:\TEST_FS>java -cp BAppletFS.jar:test_fs.jar BAppletFS test_fs Exception in thread "main" java.lang.NoClassDefFoundError: BAppletFS |
| i went searching on the forums.java.sun.com website, and found this thread (which i think is what i should be looking for): http://forum.java.sun.com/thread.jsp?forum=14&thread=443420 ..however, i looked through the advice given there and i still can't make it work. (btw. here a my %PATH% variable) Code:C:\TEST_FS>echo %PATH% C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\ATITEC~1\ATICON~1;C:\Nokia\Tools\NOKIA_~1\bin;C:\Nokia\UPDATE~1\bin |
| mikkel
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
michael05
|
Re: BApplet fullscreen modification
« Reply #8 on: Jan 31st, 2004, 8:57pm » |
|
hm.. i have got no xp-machine here to test. perhaps i can test it tomorrow on windows 2000. perhaps there is another way to enable fullscreen. i just added some lines to BApplet.java: // get default screendevice and configuration GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice (); GraphicsConfiguration gc = gd.getDefaultConfiguration(); // test if fullscreen mode is available (jvm 1.4+) and activate it if (gd.isFullScreenSupported()) { gd.setFullScreenWindow(frame); } // test if display mode is available (jvm 1.4+) and set it to the // size of the applet if (gd.isDisplayChangeSupported()) { gd.setDisplayMode(new DisplayMode(applet.g.width, applet.g.height, 32, 0)); } perhaps there is a way to enable this inside p5.
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
michael05
|
Re: BApplet fullscreen modification
« Reply #9 on: Feb 1st, 2004, 1:04pm » |
|
windows.. they separate the classpath variables with a ; instead of : in osx or linux. thats the fault. it did not include the jars. now it works. but there remains a border in windows fullscreen mode. i think there needed some attributes in the BAppletFS code. http://java.sun.com/j2se/1.3/docs/api/java/awt/Frame.html
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
mKoser
|
Re: BApplet fullscreen modification
« Reply #10 on: Feb 1st, 2004, 1:54pm » |
|
great... now i got it working aswell (allthough, as you mention, there's an annoying windows-boder!): Code:C:\TEST_FS>java -cp BAppletFS.jar:test_fs.jar BAppletFS test_fs |
| thanks for digging in to this! + mikkel
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
Mo Guest
|
Re: BApplet fullscreen modification
« Reply #11 on: Feb 12th, 2004, 9:04pm » |
|
did anyone find a solution for using the modified BApplet under Windows?
|
|
|
|
michael05
|
Re: BApplet fullscreen modification
« Reply #12 on: Feb 13th, 2004, 12:20am » |
|
on windows you have to separate the cp with ; instead of : i have added a line to the code to remove the window frame: frame.setUndecorated(true); that should work. but i cant test it because i dont have a windows box here. http://dev.m05.de/p5/BAppletFS
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
fry
|
Re: BApplet fullscreen modification
« Reply #13 on: Mar 19th, 2004, 4:42pm » |
|
something that might make this a little simpler.. change this: public class BAppletFS extends Applet { to this: public class BAppletFS { there's no reason for it so subclass applet. and then add this code to your sketch: static public void main(String args[]) { BAppletFS.main(new String[] { "yoursketchname" }); } the export the thing as an applet, and run it with: java -cp yoursketchname.jar yoursketchname
|
|
|
|
andrew hieronymi
|
Re: BApplet fullscreen modification
« Reply #14 on: Mar 20th, 2004, 6:57pm » |
|
Hi I am trying to use the BApplet with the beginVideo function on OSX with 10.3. I get the following error message in the terminal: Exception in thread "main" java.lang.NoSuchMethodError: followme_big.beginVideo(III)V at followme_big.setup(followme_big.java:81) at BApplet.init(BApplet.java:185) at BAppletFS.main(BAppletFS.java:22) Does this mean that the BApplet doesn't work with video capture? thanks in advance for any suggestions andrew
|
|
|
|
|