Share on Google+Share on Google+

GUI component
1 Answer(s)      6 years and 6 months ago
Posted in : Java Beginners
How can a GUI component handle its own events?


View Answers

October 26, 2010 at 4:56 PM


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.


Related Tutorials/Questions & Answers:
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
GUI  How to GUI in Net-beans ... ??   Please visit the following link:
GUI framework
GUI framework  what do u mean by GUI framework
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
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
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
sql component
sql component  is sql package is the component of jdbc
Java component
Java component  What is the preferred size of a component
Web component
Web component  Is HTML page a web component
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
Convert the code to GUI
GUI Application example  GUI Application example
Convert the code to GUI
GUI Example  GUI Example code to learn
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
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
Convert the code to GUI
Java GUI Class Example  Java GUI Class Example
Convert the code to GUI
GUI Application Development   GUI Application Development
Convert the code to GUI
Write a GUI Application  best way to write a GUI based application
Convert the code to GUI
Java and GUI application Example  Java and GUI application Example
Convert the code to GUI
How to Convert the code to GUI   How to convert a code into GUI
Convert the code to GUI
GUI Java JSP application  GUI Java JSP application
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: package components { import
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
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
Netbeans GUI Ribbon
Netbeans GUI Ribbon  how to create ribbon task in java GUI using netbeans
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
Java GUI - Java Beginners
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized


Advertisement null