Java 3D in fullscreen.  How?

I need to display animated 3D images in fullscreen exclusive mode and I'm using active rendering as opposed to passive. How can I display parts of the virtual universe in fullscreen mode with active rendering? Many, many thanks to whoever can help me out with this.

import java.awt.*;
public class FullScreenMode {
    private static DisplayMode[] BEST_DISPLAY_MODES = new DisplayMode[] {
        new DisplayMode(640, 480, 32, 0),
        new DisplayMode(640, 480, 16, 0),
        new DisplayMode(640, 480, 8, 0)
    Frame mainFrame;
    public FullScreenMode(GraphicsDevice device) {
        try {
            GraphicsConfiguration gc = device.getDefaultConfiguration();
            mainFrame = new Frame(gc);
            mainFrame.setUndecorated(true);
            mainFrame.setIgnoreRepaint(true);
            device.setFullScreenWindow(mainFrame);
            if (device.isDisplayChangeSupported()) {
                chooseBestDisplayMode(device);
            mainFrame.getGraphics().drawString("I'm in Full Screen MODE",50,50);
            Thread.sleep(3000);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            device.setFullScreenWindow(null);
    private static DisplayMode getBestDisplayMode(GraphicsDevice device) {
        for (int x = 0; x < BEST_DISPLAY_MODES.length; x++) {
            DisplayMode[] modes = device.getDisplayModes();
            for (int i = 0; i < modes.length; i++) {
                if (modes.getWidth() == BEST_DISPLAY_MODES[x].getWidth()
&& modes[i].getHeight() == BEST_DISPLAY_MODES[x].getHeight()
&& modes[i].getBitDepth() == BEST_DISPLAY_MODES[x].getBitDepth()
return BEST_DISPLAY_MODES[x];
return null;
public static void chooseBestDisplayMode(GraphicsDevice device) {
DisplayMode best = getBestDisplayMode(device);
if (best != null) {
device.setDisplayMode(best);
public static void main(String[] args) {
try {
GraphicsEnvironment env = GraphicsEnvironment.
getLocalGraphicsEnvironment();
GraphicsDevice device = env.getDefaultScreenDevice();
          FullScreenMode fsm = new FullScreenMode(device);
} catch (Exception e) {
e.printStackTrace();
System.exit(0);

Similar Messages

  • [Java and all else] How do you document DB design?

    Hello,
    Although most of the technical choices are explicit in SQL (UniqueKey & ForeignKey constraints, indexes,...), the semantics of the data columns and their constraints seem better served as plain human-readable comments ("ID column: identifies the plane copy; 6 figures are enough as we don't expect to sell more than 1 million planes in a foreseeable future...").
    In my current system, (EJB-based, but the DB schema is not created by the JPA-compliant ORM, but via SQL scripts), I see the following ways to write and maintain this documentation:
    - SQL comments in the schema creation and patch scripts
    - Javadoc comments in the Java source of the Entity classes.
    - UML notes in UML diagrams(1)
    - external "Architecture and design" document.
    All 4 of them are used, sometimes inconsistently, for various parts of the design choices; I mean, the docs do not contradict themselves (not yet, but it's a mere question of time), but some tables are commented in SQL scripts, others are in design docs, and the details for some columns are in entity javadocs. Although each developer may find it handier to "write" the doc via his preferred medium, it becomes increasingly difficult to "maintain" theoverall documentation.
    Our current situation is that most of the project team members are Java developers, so it would probably be better accepted and served if we standardized that we document DB tables and columns in Java source, but I am worried that:
    - someone else pouring over our DB (ex: DBA helping us to optimize things, or other team developping a data-mining tool to leverage the historical data in DB) may not be as comfortable with Java
    - this may not cover all design choices of the DB schema:
    - - - - first, although that is the case currently, in the future there might not be a 100% 1-1 mapping between e.g. each entity class and a DB table. Maybe some columns will not need to be mapped anymore,...
    - - - - second, I fear some DB constructs are not amenable to Java counterparts; no accurate idea there, I'm not an SQL nor JPA expert, but I presume Indexes, table partitioning, tablespaces, for example (yes, the DBMS is Oracle :o) are not taken into account in JPA mapping.
    And if we document those choices at the SQL level (my preferred idea so far), this will gradually make the javadocs in the entities obsolete, or removed altogether, and that will make future maintenance of the Java source risky.
    How do you document your DB design in general?
    Do you have specific advices for my case?
    Thanks in advance,
    J.
    (1) Just for the record, here are a few posts that refer to modelling the DB in UML:
    [A post on this forum highlighting that UML 1.4 standardizes a notation for RDB modelling|http://forums.sun.com/thread.jspa?messageID=1383724#1383724]
    [A DB modelling tutorial|http://www.tomjewett.com/dbdesign/dbdesign.php] (not sure whether it leverages the standard mentioned above :o)
    P.S.: "Java and all else" as in, damn, I'd love to use the familiar JDC forums and people to discuss not only Java-related issues, but also [all other things that surround Java|http://forums.sun.com/thread.jspa?threadID=5422264&tstart=0] (other technologies, processes, people) and enable to make workable systems out of Java code.

    jduprez wrote:
    Thank you again.
    A couple more questions:
    2. Table, and proc dictionary maintained as one or more text files. Those files and schema are all in source control.Do you mean, a proprietary text format (a la tabledesign.txt), or +.sql+ source files? Again, you seem to suggest the scehma info is present in two locations.I didn't say two locations unless you meant files. Then yes.Yes I meant two files. I trust the team to get the doc file lagging a few revisions behind the SQL file, and to correct that I would have to include one more step in the review process (e.g. "review CM actions to check that the doc file is updated consistently with the SQL source").
    The tool I wrote would throw errors if the comment file didn't match the schema. And if comments were not provided. That of course doesn't stop someone from documenting a table with "a table".
    You can of course keep the addtional info as special comments in the SQL, but when I did this, and even in retrospect, it seems better and perhaps easier to keep them seperate. I have done special comments in SQL before and it seems a bit of a kluge but you do have the single source. But in that case I was the only one maintaining it too.What do you mean by "special"?For code generation I have a schema file with the following (pseudo sql.)
        create mytable
           mytable_id int,
           column_foo varchar(10);
           column_fum varchar(20)
            -- Query: for_a_query (column_foo, column_fum)
        )The generator consumes the schema and generates the standard CRUD which would include a query based on the primary key.
    The above comment is used to provide an additional query where the proc is named 'for_a_query' (munged with table name) and takes two parameters (column_foo, column_fum) whose type/name matches those of the table.
    If we don't try to generate a browseable HTML out of the schema (although the idea is appealing, I don't have the resource to make such a tool), do you see anything kludgy in maintaining SQL comments interpersed within DDL code?
    Of course that is doable.

  • Java has been disabled, how can I get it back?

    Java has been disabled, how can I get it back? It seems that Apple has decided that Java has two many security problems and has disabled it. I need Java to run GeoGebra. What can I do? I tried downloading the latest update from Oracle JRE-7u13.

    Not sure what you mean.
    You cannot open itunes?

  • Using plain Java Sockets(not RMI) how..?

    hi!
    1. Using plain Java Sockets(not RMI) how can the client detect when its server
    goes down?
    There is a long time interval between client requests and the client wants
    to retain a live connection rather than disconnect after every reqest.
    Please also cc your reply to [email protected]
    Thanks,
    \Raghu

    If you try to send data when the host is gone, it throws an exception. I don'thow to check if it is alive though. I'm having the same problem right now.

  • I keep getting this pop up.To view this web content, you need to install the Java Runtime Environment. How can I get rid of it?

    I keep getting this pop up - To view this web content, you need to install the Java Runtime Environment. How do I get rid of it. 

    Most likely, you have a web plugin that depends on the Java runtime distributed by Apple, such as the Facebook video calling plugin or the "NexDef" plugin for watching baseball streams. If you no longer need the plugin, remove it. Otherwise, install Java.

  • I have mac os x 10.6.8. The system preferences doesn't show java at all. How can I install java please?

    Hi! 
    I have mac os x 10.6.8. The system preferences doesn't show java at all. How can I install java please?

    Don't change your story now. You did not say through Apple, you first gave a link to this site,
    http://www.java.com/en/download/apple.jsp
    You said, "Go there and download the latest version of Java"
    that plainly says,
    "Mac OS X Version 10.6 and below
    Use Software Update available on the Apple menu to check that you have the most up-to-date version of Java 6 for your Mac."
    This corroborates me saying that Java for Mac OS 10.6 is done through Software Update, no where else.
    If any Mac OS 10.6 user does not have Java on their Mac, they get it from Apple just as the link you provided shows it is from Apple. Not Oracle. You have provided the evidence that plainly contradicts yourself.
    This is your second link that is to Apple.
    http://support.apple.com/kb/DL1573
    Just to go over this again. Software Update not only updates Java to the latest, but if Java does not exist at all, SU will install it from scratch. And in doing so will be the latest version.
    Providing a link to Oracle's site is useless information that does not get Java installed on a Mac running 10.6.
    Message was edited by: roam

  • I updated java yesterday and I get a java.lang.security.exception. how do I fix it?

    I updated java yesterday and I get a java.lang.security.exception. how do i fix this?

    Hello russhend,
    i think this one should help you to understand your problem and then solve it.
    https://forums.oracle.com/thread/2179273.
    Thank you.

  • ElGamal - Is there some Java tutorial that shows how this can be done?

    Hello,
    I found this by doing a quick search on Google.com;
    http://www.java2s.com/Tutorial/Java/0490__Security/ElGamalexamplewithrandomkeygeneration.htm
    However I was wondering whether there is Java Tutorial that shows how ElGamal can be implemented in a Java program. I am looking to develop a client / server application that share files between them and I would like to encrypt every file being transmitted.
    Regards,
    Sim085

    Either use linked content or use InCopy Text stories.

  • My software update is complete but it appears that my Java is not working, how should I correct this?

    I'm trying to upload my pictures to a different site which requires Java.  I checked Java.com which states that Apple has it's own version of Java, but my computer will not allow me to upload my pictures even though my software is updatede.  Does this mean I don't have Java? If so, how do I get it for my laptop?

    you can try this,  on your phone, go to the app store, hit the update button on the bottom, then click on purchase, you will then see 2 tabs all/or not on this phone.   Look and see if your app is there, if it is hit the cloud icon next to it and it will download to your home screeen.

  • Printing a PDF in Java w/ print dialog - How to do it?

    Hi, here is what I'm trying to accomplish:
    I need to have a menu item named "Print" that is just a standard Print menu, like how you'd see if you selected "Print" in IE or Excel or Word. Something that lets you pick which printer you want to use, whether you have landscape or portrait printing, and whether its duplexed printing or not. And also it should let you select what printer you want to use.
    Does Java have something that lets you do this?
    Then, I need to be able to print multiple PDF files that the user has selected PRIOR to selecting the "Print" option. The filenames of these pdf files will be stored in an array.
    Anyone know how to accomplish this? Thanks so much in advance. I can be emailed via [email protected], or post here.

    Google for Java Print API.

  • Servlet sample "navimage.png.java" from CQ5-Docu "How to get fully featured Website" does not work.

    When working on the sample described in "How to create a fully featured Website", I got an error in the part "Creating the Top Navigation Component". I have discussed this at the page itself (see the comments there) and in the sling mailing list. I was told,  this forum would be the best place to find a solution. So I will ask the remaining question here:
    The sample uses a servlet "navimage.png.java" to create dynamically top navigation buttons with a meaningful text displayed.
    We have got a node "/content/mywebsite/en/products" (there are more, but it is easier to explain when focusing on one of them) with jcr:primaryType=cq:Page with childnode jcr:content with the property sling:resourceType=mywebsite/components/contentpage.
    The path "/apps/mywebsite/components/contentpage" contains a node body.jsp. The request http://localhost:4502//content/mywebsite/en/products.html renders the node /apps/mywebsite/components/contentpage/body.jsp.
    The body.jsp includes another jsp "topnav.jsp" which refers to /content/mywebsite/en/products.navimage.png by the expression "src="<%= child.getPath() %>.navimage.png"></a><%".
    The servlet "navimage.png.java" has been placed to /apps/mywebsite/components/contentpage/navimage.png.java. See inserted screenshot for the layout.
    When issuing the request, none of the expected buttons is displayed. The "Recent Requests"-tab at the OSGi-Console shows a whole bunch of message requests.
    The "GET customers.navimage.png", "GET services.navimage.png" and "GET products.navimage.png" tell me, that the request has been resolved (excerpt from the messages):
      10 (2013-02-01 15:45:18) LOG Including resource JcrNodeResource, type=mywebsite/components/contentpage, superType=null, path=/content/mywebsite/en/products/jcr:content (SlingRequestPathInfo: path='/content/mywebsite/en/products/jcr:content',  selectorString='navimage', extension='png', suffix='null')
         10 (2013-02-01 15:45:18) TIMER_START{resolveServlet(JcrNodeResource, type=mywebsite/components/contentpage, superType=null, path=/content/mywebsite/en/products/jcr:content)}
         10 (2013-02-01 15:45:18) TIMER_END{0,resolveServlet(JcrNodeResource, type=mywebsite/components/contentpage, superType=null, path=/content/mywebsite/en/products/jcr:content)} Using servlet /apps/mywebsite/components/contentpage/navimage.png.java
         10 (2013-02-01 15:45:18) LOG Applying Includefilters
    But the "GET navimage.png" does not find anything:
      10 (2013-02-01 16:08:06) TIMER_END{10,ResourceResolution} URI=/apps/mywebsite/components/contentpage/navimage.png resolves to Resource=NonExistingResource, path=/apps/mywebsite/components/contentpage/navimage.png
         10 (2013-02-01 16:08:06) LOG Resource Path Info: SlingRequestPathInfo: path='/apps/mywebsite/components/contentpage/navimage.png', selectorString='null', extension='png', suffix='null'
         10 (2013-02-01 16:08:06) TIMER_START{ServletResolution}
         10 (2013-02-01 16:08:06) TIMER_START{resolveServlet(NonExistingResource, path=/apps/mywebsite/components/contentpage/navimage.png)}
         10 (2013-02-01 16:08:06) LOG {0}: no servlet found
    So the servlet has been detected. Why isn't it displayed. When I place a real picture in the path (navimage.png) the sample works fine.
    - What can I do to detect the cause of the error
    - When becomes the servlet compiled and where is the class-file stored?
    Thank you for your support.
    Ulrich

    I almost found it now. The reason was, that I had not copied (puposely!) the images-folder to the design-folder (/etc/design/mywebsite). The servlet itself requires a node from this folder
    line 64: "String imgPath = new String(dg.getDesignPath(currentPage)+"/images/navimage_bg.jpg");"
    line 65: "Layer bg = ImageHelper.createLayer(ctx.resolver.resolve(imgPath));"
    The servlet must have failed and this is why I didn't see any buttons o my page.
    I say, I have not supplied the images purposely, because I don't like to introduce too much stuff without knowing what it is meant for. I prefer to cause an error. Learning by researching errors is most of the time more effective than having something run without exactly to understand the prerequisites.
    At the end this is also true for this case. I had many discussions on several platforms, read a lot of documents to go this short step.
    Thank you.
    Ulrich

  • I'm a new java learner from china,how should I start my journey?

    I have never learned java before,how should I start it? Dose it hard to learn?
    At the beginning,which part of it should I learn?
    Thank you !

    Advice:
    1. Learn the basics with simple command line applications first. Don't worry about complicated topics like Swing, databases, Web applications, etc. for at six months
    2. After you learn how to write, compile & run programs with just a text editor & Java compiler, download & learn to use an Integrated Development Environment, such as Eclipse. Especially, learn how to use the debugger that comes with the IDE.
    3. Experiment with lots of small programs & examples. Learn by doing (and by making mistakes).
    4 Find others in your community who use Java & learn from them.

  • Javax.servlet.ServletException: java.io.FileNotFoundException. How to catch when user

    How to catch when user enters a bogus jsp page. I have login.jsp. If someon enter log.jsp i get javax.servlet.ServletException: java.io.FileNotFoundException and then the whole path is shown. This onlyhappens with 9ias. When i was using http server that came with 9i database, i was able to catch this with send_error=true in zone.properties. It doesnt work with 9ias. How is everyone catching these errors? I cant seem to find out how to do it.
    Thanks

    Anyone have any suggestions on this? I take it noone catches this..

  • I've extended java.lang.Thread.  How do I get WebLogic to use my version?

    I want to add a String attribute to the thread class to save some extra info I need. I extended the Thread class with a private String with getter/setter methods.
    Since WebLogic instantiates the threads and not my own code, how do I get WebLogic to use my version of Thread instead of the one from java.lang?
    -Bill

    I don't think it's possible to have WLS use your own thread implementation for WLS internals. However, for your own custom work, it's pretty straight-forward to use the CommonJ Work Manager API and add your own implementation details for a thread pool.
    See documentation: http://download.oracle.com/docs/cd/E12839_01/web.1111/e13701/self_tuned.htm#i1069944
    WorkManager Javadocs: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13941/index.html?commonj/work/WorkManager.html
    Specifically providing your own Work interface implementation should hopefully allow you to meet your need.
    Edited by: james.bayer on Feb 15, 2010 6:40 AM

  • Java Printing Service (JPS) How to get printer status and pending jobs list

    Hi,
    I am trying to determine what is the current status of a printer in my computer as well as what is the list of pending printing jobs at any moment.
    I want to monitor activity on a printer in my computer, so I can capture and log the jobs that are sent to my printer over time.
    I would like to do so by monitoring the printer pending jobs list (if that can be retrieved through any java method) and make a log of changes in that list.
    Any advice on how to get the list of pending jobs of a printer?
    I checked the API and JobState class seems to be a descriptor of one single job... I suppose the method to retrieve a list of pending jobs in a printer would return an array of JobState objects... but I have not being able to find yet such method...
    Thanks in advance,
    JN

    Moderator Action:
    This post has been moved from the Java Programming,
    to the ADF forum, for closer topic alignment.
    *... and Comment:*
    Get help from people that work with ADF.
    They may have already done something like this.

Maybe you are looking for

  • [Urgent] Error: The transaction is not active

    Our process encounters some errors when the execution time takes longer than normal, e.g. 5mins. Any help is much appreciated. Process Flow: The flow consists of 3 process, 1 long-lived process and 2 short-lived processes, let say process A, B and C

  • IPhone only available from Cingular????

    Will other cellular companies be able to offer the iPhone? Wouldn't you know it....I just did the 2 year committment with Verizon!!!!!!!!! I'm thinking we need an iPhone topic area.... Powerbook 17 1.33   Mac OS X (10.4.8)  

  • Exchange 2010 Dynamic Distribution Group - RecipientContainer ignored

    Maybe someone will be able to help me with this...  I am trying to create DDGs for my organization but it seems the "RecipientContainer" is being ignored.  I have reorganized AD to include a top level OU called "Active Employees" and within that are

  • Horizontal scrolling with page control

    Hello, in my application I use Page Control for switching from page to page (at the moment it is only possible when you touch on the dots). But I want that when the user scrolls left/right the next/previous page is displayed. I know that the class UI

  • Help in Mapping please help

    Hi, I have a requirement with the source structure looking as Sourece : ACCOUNTGL 0....1 item 0...unbounded ITEMNO_ACC 0....1 CURRENCYAMOUNT 0....1 item 0...unbounded ITEMNO_ACC 0....1 CURRENCY_TYPE 0....1 CURRENCY 0.....1 XXXXXX 0......1 TARGET STRU