Results 1 to 6 of 6

Thread: Confused with GraphicsDevice class of java

  1. #1
    Join Date
    Jan 2010
    Posts
    99

    Confused with GraphicsDevice class of java

    Hello friends,

    I am IT student and studying java programming since one months. I have do one java project , I which will need to use the GraphicsDevice class of java. Because of that I need to be aware about the working of GraphicsDevice class java along with it's constructors and methods. I you posses any details about the GraphicsDevice class of java, then please let me aware about that. I am waiting for your reply.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Confused with GraphicsDevice class of java

    The GraphicsDevice class describes the graphics devices that might be available in a particular graphics environment. These include screen and printer devices. Note that there can be many screens and many printers in an instance of GraphicsEnvironment. Each graphics device has one or more GraphicsConfiguration objects associated with it. These objects specify the different configurations in which the GraphicsDevice can be used.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Confused with GraphicsDevice class of java

    Hi,

    Hopefully below example of GraphicsDevice class will solve your confusion about it:
    Code:
    import java.awt.GraphicsEnvironment;
    import java.awt.GraphicsDevice;
    import java.awt.image001.VolatileImage001;
    
    public class GraphicsDeviceDM 
    {
      public static void main(String[] ardgv) throws Exception {
    
        GraphicsEnvironment ge001 = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] gsb = ge001.getScreenDevices();
        for (int ib = 0; ib < gsb.length; ib++) {
          VolatileImage001 imb = gs[ib].getDefaultConfiguration()
              .createCompatibleVolatileImage001(1, 1);
          int bytes = gsb[ib].getAvailableAcceleratedMemory();
          if (bytes < 0)
       {
            System.out.println("Amount of memory is unlimited");
          }
          im.flush();
        }
      }
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Confused with GraphicsDevice class of java

    I suggest you to study following methods of the GraphicsDevice class:
    • setFullScreenWindow(Window wnd)
    • setDisplayMode(DisplayMode dmd)
    • isFullScreenSupported()
    • getBestConfiguration(GraphicsConfigTemplate gctm)
    • getFullScreenWindow()

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Confused with GraphicsDevice class of java

    Hi friend,

    If you want to know about the getIDstring() methods of GraphicsDevice class, then please review below java code:
    Code:
    import java.awt.GraphicsEnvironment;
    import java.awt.GraphicsDevice;
    
    public class GDClass 
    
    {
      public static void main(String[] avgn) throws Exception
    
     {
        GraphicsEnvironment FN = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] screenDevices = N.getScreenDevices();
      
         for (int XF = 0; XF < screenDevices.length; XF++)
         System.out.println(screenDevices[XF].getIDstring());
      
          }
    
      }

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Confused with GraphicsDevice class of java

    GraphicsDevice class of java programming is very essential for the description of the graphics devices. The GraphicsDevice class is basically taken from the 'java.lang.Object' class of java language. There is only one constructor is available with GraphicsDevice class. And this constructor is of type abstract, as it can't be directly instantiated. This class has ability to describe multiple graphics devices.

Similar Threads

  1. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  2. Confused with JComponent class
    By Owen Fernandes in forum Software Development
    Replies: 5
    Last Post: 18-02-2010, 09:27 AM
  3. Confused about JMenuItem class of java
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 16-02-2010, 12:23 PM
  4. Confused about JRootPane class of java
    By Mithun Seth in forum Software Development
    Replies: 5
    Last Post: 15-02-2010, 01:38 PM
  5. Confused about PrintWriter class of Java
    By ScarFace 01 in forum Software Development
    Replies: 5
    Last Post: 21-01-2010, 09:09 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,317,618.05027 seconds with 16 queries