Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

Search: 

  Tutorial: Common Component Methods

The common methods of AWT components are as follow: 1 getLocation() - This method is used to get position of the component, as a Point.

Tutorial Details:

The common methods of AWT components are as follow:

1 getLocation() - This method is used to get position of the component, as a Point. The usage of the method is shown below.

Point p = someComponent.getLocation();
int x = p.x;
int y = p.y;

One point to note here is that if you are working on Java 2 Platform then you need not to create a new point object. The x and y parts of the location can be easily accessed by using getX() and getY(). It is always efficient to use getX() and getY() methods.


 

Rate Tutorial:
http://www.roseindia.net/java/example/java/awt/common-component-methods.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Common Component Methods

View Tutorial:
Common Component Methods

Related Tutorials:

Displaying 1 - 50 of about 1607 Related Tutorials.

Common Component Methods
Common Component Methods,Common Component Methods Using Java Awt Common Component Methods     ...;         The common
 
Creating a JTable Component
Creating a JTable Component Creating a JTable Component           ...;   Now you can easily create a JTable component
 
Static/Class methods
Java: Static/Class methods Java NotesStatic/Class methods There are two types of methods. Instance methods are associated with an object and use the instance variables
 
CheckBox component in Echo3
CheckBox component in Echo3 CheckBox component...;     Some of the very useful components that are common... component in Echo3. We have used here the server-side API to create checkbox. CheckBox
 
Create a JSpinner Component in Java
Java Spinner,Create JSpinner Component in Java,Jspinner Example in Java Create a JSpinner Component in Java  ...; In this section, you will learn how to create a JSpinner component of swing
 
JSlider Component of Java Swing
: For these purposes, some methods and APIs have been used to create a JSlider component... Java Slider Example,Java JSlider,Slider Component in Java Swing,JSlider Source Code Java JSlider Component of Java Swing
 
Show Time in JSpinner Component
Display JSpinner Time,Show Time in JSpinner Component,JSpinner Time Example... Component           ... of a JSpinner Component with time. Here, you will see time is increased or decreased
 
Methods - Vocabulary
package to call the method. Some common methods that are declared... Java: Methods - Vocabulary... other methods can call this method. keywordaccess noneIf you
 
Methods - Example
Java: Methods - Example Java NotesMethods - Example Example This example shows a simple..., but this is a common style. The body of this simple function contains a declaration
 
Abstract methods and classes
Abstract class,Abstract methods and classes Abstract methods and classes        ... language the word abstract is used with methods and classes.  Abstract Method
 
Disabling Keyboard Editing in a JSpinner Component
Disabling Keyboard Editing in a JSpinner Component - Java JSpinner Swing... in a JSpinner Component         ... to create a non editable Spinner component of Java Swing. You can increase
 
Summary - Basic GUI Components
Java: Summary - Basic GUI Components Java: Summary - Basic GUI Components Most components have a few common methods. cmp.requestFocus(); Puts focus (eg, blinking cursor) in field
 
Old and New Vector Methods
Java: Old and New Vector Methods Java: Old and New Vector Methods When the new Collections API... was updated to implement the List interface. Use the List methods because
 
Setting Tool Tip Text for items in a JList Component
Setting Tool Tip Text for items in a JList Component Setting Tool Tip Text for items in a JList Component  ... in the JList component of the Java Swing. Tool Tip text is the help text of any component
 
Adding a Rollover and Pressed Icon to a JButton Component in Java
to a JButton Component in Java      ... adding event i.e. the rollover and click icon to a JButton component of swing... are managed by the program using some APIs or methods as follows
 
Passing Arrays In Jsp Methods
Passing Arrays In Jsp Methods Passing Arrays In Jsp Methods         ... html static component with the dynamically generated contents from servlets
 
Create a JRadioButton Component in Java
Radio Button Component,Java Radio Button Example,Radio Button Code in Java Swing Create a JRadioButton Component in Java..., you will see the JRadioButton component creation procedure in java with the help
 
Adding an Input Map to a Component
Inputmap Component Java,Adding an Input Map to a Component - Java Swing Tutorials Adding an Input Map to a Component... component. Specific task for the component is assigned for the specific key combination
 
Limiting the Values in a Number JSpinner Component
Limiting the Values in a Number JSpinner Component - Java Swing Tutorials... Component          ... set the minimum value of the JSpinner component. In this program, you will see
 
Keyboard
() and KeyReleased() Three methods must be defined in a class that implements.... keyPressed(KeyEvent e) and keyReleased(KeyEvent e) These methods are called whenever... events, which call these methods: KeyPressed for pressing the shift key
 
Selecting a Radio Button component in Java
Select Radio Button,Selection Radio Button in Java,Radio Button Selection Component in Java Selecting a Radio Button component... program: For this purposes, there are some APIs or methods have been used
 
Methods - OOP
Java: Methods - OOP Java NotesMethods - OOP Static methods If your method doesn't... utility methods and main(...), you should probably not be using static
 
Facelet component Tag
Facelet composition Tag Facelet component Tag...;    This tag is used to add a new component into the JSF component tree as children of UI component instance. This tag shows its behavior
 
MouseListener
enters or leaves the area of the component with a listener. Here.... entermouse cursor enters the component. Often used to change cursor. exit mouse cursor exits the component. Often used to restore cursor. To listen
 
Second Window
a subclass of JFrame (a window) that constructs a JPanel to put the one component on. In this case the component is a button that does nothing. 1 2 3 4...). This is OK for amlll programs, but its also common to add a listener to ask
 
Create a JList Component in Java
Create a JList Component in Java    ..., you will learn how to create a JList component of swing. JList is a component of GUI. It provides the multiple items in a list and some times it shows
 
Objective-C Inheritance
; Objective-C enables programmer to inherit common methods and properties from other class, known as inheritance. Class from methods and properties... methods and properties of Vehicle class.       
 
Create a JComboBox Component in Java
Component in Java Create a JComboBox Component... Component of swing in java. The JComboBox is used to display drop-down list...;a JComboBox Component");     JPanel 
 
Getting Methods Information of a class
Getting Methods Information of a class Getting Methods Information of a class     ... will learn how to retrieve information of all methods of a class (that included
 
Summary - Character
: Summary - Character Character class static methods Character Class Methods Character class is used mostly for static methods to test char values. b .... The most common implmentation of it uses 16 bits, which is 65,536 characters
 
Getting Component type
Getting Component type Getting Component type... retrieve Component Type of an array's element. The component type of an Array... component type will also be integer. Here is the example code of ComponentType
 
Methods - Introduction
Java: Methods - Introduction... will use method. Why use methods? For reusable code... a method for solving your big problem by calling on other methods
 
Images - BufferedImage
of an existing component (eg, a JPanel), or by using a BufferedImage constructor, in which... from another component. Some properties components are not known during... change during layout. Therefore, a common technique is to delay
 
Summary: Methods
Java Summary: Methods Java: Summary: Methods Parameters Method parameters are separated by commas. Parameters are converted to these larger or equal types (int, long, double
 
Methods - Calling
Java: Methods - Calling Java Notes Methods - Calling.... When you call methods which are defined in your own class, you don't need
 
Methods - Declaring
Java: Methods - Declaring...() and paintComponent() methods to be public so that the browser and Java GUI code... it. static The static keyword is used to declare class methods -- methods
 
Methods of Servlets
Methods of Servlets Methods of Servlets...; A Generic servlet contains the following five methods: init() public void init... calls the destroy() method, no service methods will be then called . That is after
 
JSP methods
JSP methods JSP methods               ... for declaration the variables and methods. In the method we are adding to numbers
 
Making a component drag gable in java
Swing Drag Drop,Making Component Draggable in Java,Drag and Drop Example in Java Making a Component Draggable in Java...; In this section, you will learn how to make a component draggable in java
 
Tiny Window with subclass
This is a reimplementation of the TinyWindow program, but using the most common style... more common to just stick the main program into one of the other classes... - Common JFrame subclass style for GUI // Fred Swartz, 2004-10-28 import java.awt.
 
Common Interview Questions
Common Interview Questions Common Interview... common interview questions the interviewer is likely to ask as such as: tell me...; Common Interview Questions - Page 1 Tell Me a Little About Yourself? Ans
 
Common Interview Questions
Common Interview Questions Common Interview... common interview questions the interviewer is likely to ask as such as: tell me...; Common Interview Questions - Page 1 Tell Me a Little About Yourself? Ans
 
Disabling User Edits in a JTable Component
Disabling User Edits in a JTable Disabling User Edits in a JTable Component       ... you, how to disable the user edits in a JTable component means editing
 
Creating Dynamic Tree component in RCFaces
Creating Dynamic Tree component in RCFaces Creating Dynamic Tree component in RCFaces    ... will illustrate you that how you can create a dynamic tree component with the use
 
Common concerns to build a project
common concerns while building a project Common concerns to build a project       ...;       Some of the common concerns
 
Customize the Icon in a JCheckBox Component of Java Swing
Customized Checkbox Java,Customize the Icon in a JCheckBox Component of Java... in a JCheckBox Component of Java Swing      ... to customize the icon in a check box component. That means any icon can be shown
 
Understanding Common SQL statements
Understanding Common SQL statements Understanding Common SQL statements                     
 
Common SQL Commands
Common SQL Commands Common SQL Commands                           SQL
 
Setting the Dimensions of an Item in a JList Component in Java
in a JList Component in Java        ... about setting the dimensions of the List component in java. A list can have... Component. This provides setting the dimension of items present in the list. You can
 
Common Interview Questions and Their Answers.
Common Interview Questions and Their Answers (1-25) Common Interview Questions and Their Answers.               
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.