Results 1 to 6 of 6

Thread: Use of JWindow class in java

  1. #1
    Join Date
    Dec 2009
    Posts
    38

    Use of JWindow class in java

    Hello Friends,

    I am new to java programming field. I want to be aware about the functionality of JWindow class of java. As per my java knowledge JWindow class is nothing but the part of swing component. I also want to know it's declaration. If anyone posses sound knowledge about the JWindow class , then please try to share it me. I will greatly appreciate you any help over 'JWindow class' of java.

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

    Re: Use of JWindow class in java

    Hi friend,

    A JWindow is a container that can be displayed anywhere on the user's desktop. It does not have the title bar, window-management buttons, or other trimmings associated with a JFrame, but it is still a "first-class citizen" of the user's desktop, and can exist anywhere on it. The JWindow component contains a JRootPane as its only child. The contentPane should be the parent of any children of the JWindow.

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

    Re: Use of JWindow class in java

    JWindow class is used as a one of he container in java. It is very simple to use this JWindow class. Following program shows the use of the JWindow() method of this class:
    Code:
    import javax.swing.JWindow;
    
    public class JWindowDemo
    
    {
      public static void main(String arg[]) 
    
      {
        JWindow w1 = new JWindow(  );
    
        w1.setSize(200, 000);
        w1.setLocation(400, 100);
    
        w1.setVisible(true);
    
      }
    
    }

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Use of JWindow class in java

    To know the functionality of JWindow class of java, you need to make use following it's methods:
    • update(Graphics gp)
    • setRootPaneCheckingEnabled(boolean enabled)
    • setContentPane(Container NameOfcontentPane)
    • setGlassPane(Component glassPaneName)
    • setRootPane(JRootPane rootName)
    • remove(Component cmp)

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Use of JWindow class in java

    A JWindow class comprises number of constructors. 'JWindow(Window ownerName) is one it's important constructor. This constructor of JWindow is used only when you want to create window along with the particular owner window. While the 'JWindow(GraphicsConfiguration gpc)' constructor of JWindow is used when you create a window which has particular GraphicsConfiguration for the screen device.

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Use of JWindow class in java

    Following is example of JWindow class, please go through this:
    Code:
    import javax.swing.JWindow;
    import javax.swing.JFrame;
    
    public class JWsample {
      public static void main(String[] ars) {
        JFrame fe = new JFrame("The Frame");
        fe.setSize(300, 300);
        fe.setLocation(100, 100);
    
        JWindow wn = new JWindow();
        wn.setSize(500, 300);
        wn.setLocation(400, 100);
    
        fe.setVisible(true);
        wn.setVisible(true);
      }
    }

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. KeyboardFocusManager class of java
    By Gokul20 in forum Software Development
    Replies: 4
    Last Post: 05-03-2010, 03:38 PM
  3. JDesktopPane class of java
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 18-02-2010, 08:14 AM
  4. RecordStore class in java
    By Level8 in forum Software Development
    Replies: 4
    Last Post: 12-12-2009, 02:12 PM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 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,714,761,987.51690 seconds with 17 queries