samar
GUI component
1 Answer(s)      2 years and 7 months ago
Posted in : Java Beginners

How can a GUI component handle its own events?
View Answers

October 26, 2010 at 4:56 PM


Hi,

Here is the answer,

A GUI component handles its events by implementing the required event listener interface.It adds its own event listener in order to keep a track of all events associated with it.AWT has Java1.0 and Java1.1 of Event handling in different manners: In Java1.0:Event handling is based on inheritance.A program catches and processes GUI events by subclassing GUI components and override either action() or handleEvent() methods.There are two possibilities in this scenario:

a)Each component is subclassed to specifically handle its target events. The results in too many classes.

b)All events or a subset for an entire hierarchy for handling a particular container; results in container's overridden action() or handleEvent() method and complex conditional statement for events processing.

Thanks.









Related Pages:
GUI component
GUI component  How can a GUI component handle its own events
Component gui - Java Beginners
Component gui  Can you give me an example of Dialog in java Graphical user interface?  Hi friend, import javax.swing.*; public class DialogPaneDemo { public static void main(String[] args
Container or Component - Java Beginners
about the realtionship between Components and Containers in Java GUI? 1) a component is a subclass of a container which means any container can hold a component 2) a component is allowed to hold other components including containers. 3
Rationale for GUI tutorial decisions
Table of Contents Rationale for GUI tutorial decisions Java offers many... learn GUI programming? All "normal" programs are GUI based, so this question... that some Java textbooks are written without any GUI coverage, and others cover
GUI
GUI  How to GUI in Net-beans ... ??   Please visit the following link: http://www.roseindia.net/java/java-tips/background/30java_tools/netbeans.shtml
Serializing GUI Components Across Network - tutorial
the component in response to pushing a GUI button, it will work, because then you are using...). The solution is to wrap the gui component in an object of which you control...Serializing GUI Components Across Network 2001-03-14 The Java Specialists
Create a JList Component in Java
component of swing. JList is a component of GUI. It provides the multiple items... Create a JList Component in Java   ... easily add or remove items from or to the JList component of swing. The JList
Common Component Methods
Common Component Methods      ... getLocation() - This method is used to get position of the component, as a Point... the position of  the upper-left corner of the screen of the component, as a Point
GUI - Swing vs. AWT
Java: GUI - Swing vs. AWT The original graphical user interface (GUI... and extendability problems with AWT were resolved by introducing a new GUI interface, known... many AWT non-component classes remain in use. Upward compatibility is assured
GUI framework
GUI framework  what do u mean by GUI framework
Web component
Web component  Is HTML page a web component
Java component
Java component  What is the preferred size of a component
sql component
sql component  is sql package is the component of jdbc
gui question
gui question  design a gui application for me and write its code in which the user enters a no. in a textfield and onn clicking the button the sum of the digits of the no. should be displayed. hint: suppose the user enters 12
GUI problem
GUI problem  Create a class called CDProgram and write a GUI program to compute the amount of a certificate of deposit on maturity. The sample data follows: Amount deposited: 80000.00 Years: 15 Interest Rate: 7.75 Hint
Creating a JTable Component
Creating a JTable Component       Now you can easily create a JTable component. Here, the procedure for creating a JTable component is given with the brief description
java gui
java gui   friends... good day.. i have doubt in java gui. ? i created 1 java gui application. That has two text fields jtext1,jtext2. case: user entered value in first textfield(jtext1) and pressed the enter key . the cursor
Convert the code to GUI
GUI code  GUI code
Java GUI
Java GUI  1) Using Java GUI, create a rectangular box that changes color each time a user click a change color button. 2) Modify Question 1 to include a new button named insert image, that allow user to insert a bitmap image
MXML component
MXML component  Hi..... Please tell me about that prob When I set visible=?false?, the component still takes up space and appears in the tab order. Why is that? Thanks  Ans: You can often achieve the "display
Component in actionscript
Component in actionscript  Hi...... Have you built any components with actionscript? If so explain how you did it? please give me the example for that....... Thanks   Ans: CityComboBox.as package components { import
gui question
gui question  design a gui application and write code to accept a string from the user in a textfeild and print using option pane whether it is a palindrome or not. hint: abba is a palindrome   import java.awt.*; import
Convert the code to GUI
GUI Application example  GUI Application example
Convert the code to GUI
GUI Example  GUI Example code to learn
GUI problem
GUI problem  How do I make a Jbutton which is shaped like a circle. This button needs to be clicked in order to change color.   import java.awt.*; import java.awt.geom.*; import javax.swing.*; public class
GUI Structural Patterns
the Model In all ways of structuring a GUI program, there is one vitally important...) with the following interfaces. GUI interface. And it should be easy to change between Swing, SWT, XML based GUI, etc. Command line interface - yes, some
Convert the code to GUI
Java GUI Class Example  Java GUI Class Example
Convert the code to GUI
GUI Java JSP application  GUI Java JSP application
Convert the code to GUI
GUI Application Development   GUI Application Development
Convert the code to GUI
Java and GUI application Example  Java and GUI application Example
Convert the code to GUI
Write a GUI Application  best way to write a GUI based application
Convert the code to GUI
How to Convert the code to GUI   How to convert a code into GUI
Java component class
Java component class  Which method of the Component class is used to set the position and size of a component
Netbeans GUI Ribbon
Netbeans GUI Ribbon  how to create ribbon task in java GUI using netbeans
Convert the code to GUI
How to create GUI application in Java   How to create GUI application in Java
Convert the code to GUI
Java Code to GUI   can any one convert My code to GUI code
Java GUI - Java Beginners
Java GUI  HOW TO ADD ICONS IN JAVA GUI PROGRAMMES
Convert the code to GUI
Convert the code   How to convert a code to GUI look alike
Convert the code to GUI
Is it possible to convert a code into GUI  Is it possible to convert a code into GUI
What is component mapping in Hibernate?
What is component mapping in Hibernate?  Hi, What is component mapping in Hibernate? thanks
web component development
web component development  sir ineed objectives type questions
web component development
web component development  sir ineed objectives type questions
business component development
business component development  sir ineed objectives type questions
Magic Matrix in GUI
Magic Matrix in GUI  I want program in java GUI contain magic matrix for numbers
Regarding GUI Applications
Regarding GUI Applications  How to create a save and open jmenu item in java desktop application
Facelet component 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
Example - Calc GUI
Java: Example - Calc GUI Example - Calc Main, Example - Calc GUI, Example... GUI @author Fred Swartz @version 2004-04-20 Rodenbach */ import java.awt.... { //=============================================== instance variables //--- Component referenced during execution private

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.