Forums Register Login

doubt with this component

+Pie Number of slices to send: Send
is MouseAdapter a swing component?
+Pie Number of slices to send: Send
No it's something you use in Events in Java. A way of circumventing the need to override all the methods of the interface you implement for a MouseListener
+Pie Number of slices to send: Send
I dont have much idea but,
As per i know
mouseAdaptor is an interface...........
+Pie Number of slices to send: Send
hey guys i know it is a awt component . but i want to know if there is any swing component
+Pie Number of slices to send: Send
No MouseAdapter is not a swing component as in a graphical component. If you could give a more detailed description of what you are trying to do we could be of more assistance.
+Pie Number of slices to send: Send
I'm going to move this to the Swing forum, where you should get a better response.
[ August 03, 2007: Message edited by: Fred Rosenberger ]
+Pie Number of slices to send: Send
 

Originally posted by prasanna sheregar:
is MouseAdapter a swing component?

i know it is a awt component . but i want to know if there is any swing component



Be careful with the term component. To most of us, saying "is a component" means that it is a subclass of java.awt.Component. ("Is a swing component" could even mean that it's a subclass of javax.swing.JComponent, but this is less clear cut. For example, JFrame is a subclass of Component but not of JComponent.)

But MouseAdapter is not a subclass of java.awt.Component, so I would say that MouseAdapter isn't a component at all (neither swing nor awt). This makes sense since there's no way to display a MouseAdapter on the computer screen. So what exactly are you trying to ask?
+Pie Number of slices to send: Send
Maybe this will help you sort out the confusion.
Try and map to the MVC architecture.
You can think of components as the "View". If they can be displayed on the screen, you can safely think of them as the view.
Classes like the MouseAdapter are the "Controller". Though they are not visible, they form the mode of interaction between the user and the view component.

Technically speaking, the MouseAdapter is an adapter class for the MouseListener interface. You can find many such adapter classes corresponding to some iterface. E.g. MouseMotionAdapter(class) --> MouseMotionListener (interface),KeyAdapter (class)-->KeyListener (interface). As Michael rightly pointed out, the idea is to get a "ready made" class which implements the interface containing multiple methods. Then you need to override only the ones you want.
It means our mission is in jeapordy! Quick, read this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1035 times.
Similar Threads
Web services and Components?
class vs component
Updating Components
How to handle JComboBox?
Printing GUI current Coordinates in the GUI
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:05:13.