Component: setLocation(int x, int y) : Component « java.awt « Java by API

Java by API
1. com.sun.image.codec.jpeg
2. java.applet
3. java.awt
4. java.awt.datatransfer
5. java.awt.dnd
6. java.awt.event
7. java.awt.font
8. java.awt.geom
9. java.awt.im.spi
10. java.awt.image
11. java.awt.print
12. java.beans
13. java.beans.beancontext
14. java.io
15. java.lang
16. java.lang.annotation
17. java.lang.instrument
18. java.lang.management
19. java.lang.ref
20. java.lang.reflect
21. java.math
22. java.net
23. java.nio
24. java.nio.channels
25. java.nio.charset
26. java.rmi.dgc
27. java.rmi.server
28. java.security
29. java.security.cert
30. java.security.spec
31. java.sql
32. java.text
33. java.text.spi
34. java.util
35. java.util.concurrent
36. java.util.concurrent.atomic
37. java.util.concurrent.locks
38. java.util.jar
39. java.util.logging
40. java.util.prefs
41. java.util.regex
42. java.util.spi
43. java.util.zip
44. javax.accessibility
45. javax.activation
46. javax.annotation.security
47. javax.comm
48. javax.crypto
49. javax.crypto.spec
50. javax.ejb
51. javax.imageio
52. javax.imageio.event
53. javax.jws
54. javax.mail
55. javax.mail.internet
56. javax.media.jai
57. javax.microedition.io
58. javax.microedition.lcdui
59. javax.microedition.media
60. javax.microedition.media.control
61. javax.microedition.midlet
62. javax.microedition.pim
63. javax.microedition.rms
64. javax.naming
65. javax.naming.directory
66. javax.naming.event
67. javax.naming.ldap
68. javax.naming.spi
69. javax.net
70. javax.net.ssl
71. javax.persistence
72. javax.print
73. javax.print.attribute
74. javax.print.attribute.standard
75. javax.print.event
76. javax.script
77. javax.servlet
78. javax.servlet.http
79. javax.sound.midi
80. javax.sound.sampled
81. javax.sql
82. javax.sql.rowset
83. javax.swing
84. javax.swing.border
85. javax.swing.colorchooser
86. javax.swing.event
87. javax.swing.filechooser
88. javax.swing.plaf.basic
89. javax.swing.plaf.metal
90. javax.swing.plaf.synth
91. javax.swing.table
92. javax.swing.text
93. javax.swing.text.html
94. javax.swing.text.html.parser
95. javax.swing.text.rtf
96. javax.swing.tree
97. javax.swing.undo
98. javax.tools
99. javax.transaction
100. javax.xml
101. javax.xml.bind
102. javax.xml.bind.annotation
103. javax.xml.crypto.dsig
104. javax.xml.crypto.dsig.keyinfo
105. javax.xml.namespace
106. javax.xml.parsers
107. javax.xml.soap
108. javax.xml.stream
109. javax.xml.stream.events
110. javax.xml.transform
111. javax.xml.transform.dom
112. javax.xml.transform.stream
113. javax.xml.validation
114. javax.xml.ws
115. javax.xml.xpath
116. junit.extensions
117. junit.framework
118. junit.textui
119. org.apache.commons.lang
120. org.apache.commons.lang.builder
121. org.apache.commons.lang.exception
122. org.apache.commons.lang.time
123. org.apache.commons.logging
124. org.apache.commons.math
125. org.eclipse.jface.action
126. org.eclipse.jface.dialogs
127. org.eclipse.jface.operation
128. org.eclipse.jface.viewers
129. org.eclipse.jface.window
130. org.eclipse.jface.wizard
131. org.eclipse.swt
132. org.eclipse.swt.browser
133. org.eclipse.swt.custom
134. org.eclipse.swt.dnd
135. org.eclipse.swt.events
136. org.eclipse.swt.graphics
137. org.eclipse.swt.layout
138. org.eclipse.swt.ole.win32
139. org.eclipse.swt.printing
140. org.eclipse.swt.program
141. org.eclipse.swt.widgets
142. org.junit
143. org.w3c.dom
144. org.xml.sax
145. org.xml.sax.helpers
146. sun.audio
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java by API » java.awt » Component 
Component: setLocation(int x, int y)
  


/*
 * Copyright (c) Ian F. Darwin, http://www.darwinsys.com/, 1996-2002.
 * All rights reserved. Software written by Ian F. Darwin and others.
 * $Id: LICENSE,v 1.8 2004/02/09 03:33:38 ian Exp $
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 
 * Java, the Duke mascot, and all variants of Sun's Java "steaming coffee
 * cup" logo are trademarks of Sun Microsystems. Sun's, and James Gosling's,
 * pioneering role in inventing and promulgating (and standardizing) the Java 
 * language and environment is gratefully acknowledged.
 
 * The pioneering role of Dennis Ritchie and Bjarne Stroustrup, of AT&T, for
 * inventing predecessor languages C and C++ is also gratefully acknowledged.
 */

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

/**
 * Internal Frames Demo
 
 @version $Id: JIFrameDemo.java,v 1.4 2003/07/15 01:46:47 ian Exp $
 */
public class Main {

  /* Main View */
  public static void main(String[] a) {
    final JFrame jf = new JFrame("JIFrameDemo Main Window");

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    screenSize.width -= 42;
    screenSize.height -= 42;
    jf.setSize(screenSize);
    jf.setLocation(2020);

    JMenuBar mb = new JMenuBar();
    jf.setJMenuBar(mb);
    JMenu fm = new JMenu("File");
    mb.add(fm);
    JMenuItem mi;
    fm.add(mi = new JMenuItem("Exit"));
    mi.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.exit(0);
      }
    });

    JDesktopPane dtp = new JDesktopPane();
    //dtp.setBackground(Color.GREEN);
    jf.setContentPane(dtp);

    JInternalFrame mboxFrame = new JInternalFrame("Mail Reader", true,
        true, true, true);
    JLabel reader = new JLabel("Mail Reader Would Be Here");
    mboxFrame.setContentPane(reader);
    mboxFrame.setSize(400300);
    mboxFrame.setLocation(5050);
    mboxFrame.setVisible(true);
    dtp.add(mboxFrame);

    JInternalFrame compFrame = new JInternalFrame("Compose Mail", true,
        true, true, true);
    JLabel composer = new JLabel("Mail Compose Would Be Here");
    compFrame.setContentPane(composer);
    compFrame.setSize(300200);
    compFrame.setLocation(200200);
    compFrame.setVisible(true);
    dtp.add(compFrame);

    JInternalFrame listFrame = new JInternalFrame("Users", true, true,
        true, true);
    JLabel list = new JLabel("List of Users Would Be Here");
    listFrame.setContentPane(list);
    listFrame.setLocation(400400);
    listFrame.setSize(500200);
    listFrame.setVisible(true);
    dtp.add(listFrame);

    jf.setVisible(true);
    jf.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        jf.setVisible(false);
        jf.dispose();
        System.exit(0);
      }
    });
  }
}

   
    
  
Related examples in the same category
1. Component.BOTTOM_ALIGNMENT
2. Component.CENTER_ALIGNMENT
3. Component.LEFT_ALIGNMENT
4. Component.RIGHT_ALIGNMENT
5. Component.TOP_ALIGNMENT
6. Component: enableEvents(long eventsToEnable)
7. Component: getAccessibleContext()
8. Component: getLocationOnScreen()
9. Component: isFocusable()
10. Component: isFocusCycleRoot
11. Component: requestFocusInWindow()
12. Component: setBounds(int x,int y,int width,int height)
13. Component: setComponentOrientation(ComponentOrientation o)
14. Component: setSize(int width, int height)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.