• Post Reply Bookmark Topic Watch Topic
  • New Topic

My own Component?

 
Mike Cole
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

i want to make a class that has a visual representation on the screen and reacts to mouse-clicks or other events. I DONT want to interhit it from a JComponent, Button or something. I want to build it from the ground up, which will also teach me a bit more about Java (classes and interfaces i havent seen so far). While this is a nice aim... i have problems where to start.

What are the minimum requirements(Interfaces/Classes) my own class needs to reach these goals? (Visual representation and "clickable")

Thnak you for your time,

Mike
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, to appear on the screen, it has to inherit from java.awt.Component, at the very least. Generally you'd extend one of the more convenient subclasses like Panel, Canvas, JPanel -- or JComponent if, as you say, you're really interested in building something from the ground up.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!